Skip to content

feat(server): server-side scheduled tasks — start agent runs automatically - #7986

Open
ImBIOS wants to merge 2 commits into
pingdotgg:mainfrom
ImBIOS:feat/scheduled-tasks-upstream
Open

feat(server): server-side scheduled tasks — start agent runs automatically#7986
ImBIOS wants to merge 2 commits into
pingdotgg:mainfrom
ImBIOS:feat/scheduled-tasks-upstream

feat(server): gate scheduled tasks behind a settings switch

d9b0640
Select commit
Loading
Failed to load commit list.
MacroscopeApp / Macroscope - Correctness Check completed Aug 25, 2026 in 6m 36s

2 issues identified (8 code objects reviewed).

• Merge Base: 2433f4c
• Head: d9b0640

Details

File Path Comments Posted Reason
docs/user/scheduled-tasks.md
apps/server/src/orchestration/Layers/TaskScheduler.ts 1
apps/server/src/orchestration/Layers/TaskScheduler.test.ts Excluded by default ignore patterns
apps/server/src/serverSettings.test.ts Excluded by default ignore patterns
packages/contracts/src/settings.ts 0
apps/web/src/components/settings/settingsSearch.ts 0
apps/web/src/components/settings/ProjectSettingsPanel.tsx 1
apps/web/src/components/settings/SettingsPanels.tsx 0
apps/web/src/components/settings/IntegrationsSettings.tsx 0

Filtered Issues Details

apps/server/src/orchestration/Layers/TaskScheduler.ts
  • line 86: When an anchor thread is deleted, the decider rejects task.fire before advancing the task's nextFireAt, while listDueTasks continues returning that armed row. This loop catches the rejection at lines 86-91 and treats it as a completed tick, so the same one-shot or interval task is dispatched and warned about every 15 seconds forever until manually cancelled. The scheduler should retire/cancel or otherwise suppress permanently un-fireable tasks (or distinguish transient failures from this invariant failure). [ Already posted ]
apps/web/src/components/settings/IntegrationsSettings.tsx
  • line 379: ScheduledTasksSetting is rendered unconditionally, without checking the environment's optional taskScheduling capability. With a newer web client connected to an older server, the missing setting field is decoded as the new default (true) and this switch is shown, but the older server's ServerSettingsPatch ignores the unknown enableScheduledTasks property, so clicking it appears to succeed while neither changing persisted settings nor disabling anything. Hide or disable this control when the primary server does not advertise task scheduling. [ Out of scope (post-validation triage) ]
apps/web/src/components/settings/ProjectSettingsPanel.tsx
  • line 1149: This mounts ScheduledTasksSection whenever the primary settings flag is enabled, even when representative.environmentId does not advertise taskScheduling. The child calls useAtomValue(orchestrationEnvironment.scheduledTasks(...)) before its internal if (!supported) return null, so opening this page against an older or mixed-version environment still issues the unsupported orchestration.listTasks query (and its refreshes) despite the section being hidden. Gate the mount using that environment capability or split the query-free unsupported path outside the child. [ Out of scope (post-validation triage) ]
  • line 1150: The scheduled-task UI is mounted for a logical group but is hard-coded to representative.environmentId/representative.id and filters threads to that one physical checkout. For a grouped project with multiple checkouts, tasks are environment-scoped (the query and commands receive environmentId), so tasks on any non-representative checkout are neither listed nor cancellable, and new tasks can only be anchored to representative threads. Selecting another checkout in the page's checkout selector does not change this section, leaving those projects' scheduled-task functionality inaccessible. [ Already posted ]