Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Follow-up to #36813 and #36821. That PR saves a non-Git task at the root on every save. It lists "Tasks saved before this change keep their worktree strategy until they're saved again" as out of scope. Nothing tracks that part, and it still fails runs.
Area
apps/server
Steps to reproduce
- On a server older than fix(server): scheduled tasks in a non-Git project run in its folder instead of failing #36821, create a scheduled task through MCP
schedule_taskin a project whose folder isn't a Git repository. UsebindToCurrentThread: falseand aonceschedule a few days out. The row savesworkspace_strategy_jsonas{"type":"worktree","baseRef":"main","startFromOrigin":true}. - Update the server to a build that has fix(server): scheduled tasks in a non-Git project run in its folder instead of failing #36821. Don't edit the task.
- Let the task fire.
Expected behavior
The run starts in the project folder, the same as a task saved after #36821.
Actual behavior
The run fails before the provider starts:
Workspace preparation failed during provision worktree: Git command failed in GitWorkflowService.resolveWorktreeBaseRemote (<project root>): Failed to resolve the VCS driver for this Git command.
The fallback only runs in ScheduledTaskService.upsert (apps/server/src/scheduledTasks/ScheduledTaskService.ts:1591). At fire time the task passes active.workspaceStrategy to threadLaunch.launch unchanged (ScheduledTaskService.ts:1136). No migration rewrites old rows either. A once task never gets saved again, so it can never pick up the fix.
Same server, same non-Git project: two tasks saved on 2026-11-25 have {"type":"root"} and run fine. The one saved on 2026-11-16 still has worktree and failed.
Possible fixes:
- Apply the
isNonGitProjectcheck at launch for scheduled runs too, so stale rows fall back to the root. - Or add a one-time migration that rewrites worktree rows in non-Git projects to
root.
The launch-time check also covers a project folder that stops being a Git repo after the task is saved.
Related, already noted in #36821: a message sent to the failed thread afterwards stays queued and never starts.
Impact
Major degradation or frequent failure
Version or commit
0.1.12-nightly.20261124.5178. Code unchanged on main @ 219c7be.
Environment
Linux (Ubuntu), t3 serve, Claude provider.
Workaround
Re-save the task so upsert rewrites its strategy. Or delete it and create it again. A task that already fired needs a new thread.
Activity