You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: "workspace preparation failed" on scheduled task for "no project" #17309
Thanks for the report — this looks real on current main (580948708).
What happens
A scheduled task stores workspaceStrategy on the row and, when unbound, launches with that strategy as-is (ScheduledTaskService.runTask → threadLaunch.launch, ~L798–805). The schedule editor defaults new tasks to Create a new worktree (EMPTY_DRAFT.workspaceMode: "worktree", ScheduledTasksSettings.tsx ~L127) and still lists the Scratch project titled No project as an ordinary project (ManagedProjectFolders bootstraps it with that title). There is no UI or upsert guard that forbids worktree/checkout modes for Scratch.
At run time, type: "worktree" always calls git.createWorktree against project.workspaceRoot (ThreadLaunchService.prepareInBackground, ~L321–404). Scratch is not a git repo (ManagedProjectFolders.ts header: Scratch is a plain folder with per-thread subfolders). That most likely fails and surfaces as Workspace preparation failed (failureDetail, ThreadLaunchService.ts ~L165–171).
The path that does work for No project is type: "root": launch remaps Scratch root launches into a fresh per-thread folder via managedFolders.folderForThread (ThreadLaunchService.ts ~L746–763).
Web-only: adds an explicit No project choice, hides workspace/base-branch/checkout controls for that choice, and on save forces { type: "root" } via workspaceStrategyFromDraft(draft, noProject). That should stop new UI saves (and a re-save of an existing Scratch task) from storing worktree mode.
It does not fully close this on its own:
no server coerce/ignore of a stored worktree strategy for Scratch / non-git cwd at upsert or run time
MCP schedule_task still hard-codes unbound tasks to { type: "worktree", baseRef: "main", startFromOrigin: true } (OrchestratorMcpService.scheduledTaskWorkspaceStrategy, ~L228–233) — same failure already noted on #16183
Server-side: when the target is Scratch (or cwd is not a git repo), coerce worktree / invalid checkout strategies to root (or reject with a clear error) on upsert and at launch, so existing tasks and MCP don’t keep failing.
Teach MCP schedule_task to pick root for Scratch / non-git projects (overlaps #16183).
Workaround: edit the task → Workspace → Use the project checkout (root), then run again.
Related (same Scratch + git-worktree mismatch, different entry): #16183. Nearby No-project threads but different bugs: #17166, #17187.
I traced this on main only — I did not run a scheduled task end-to-end.
Confirmed end-to-end on T3 Code 0.0.46-nightly.20261008.2849, Windows x64, at 2026-10-09 03:14:17 UTC. This adds a live MCP reproduction to the source analysis above.
Minimal reproduction
Start a conversation under No project (the managed Scratch project).
Call schedule_task from that conversation with:
{
"title": "Repro: no-project scheduled fresh thread",
"prompt": "Reply exactly SCHEDULER_REPRO_OK. Do not use tools or do any other work.",
"schedule": { "type": "interval", "everyMs": 86400000 },
"bindToCurrentThread": false,
"enabled": false
}
Call run_scheduled_task_now with the returned task ID. The disabled schedule permits a manual run without leaving recurring work active.
Inspect the newly created thread with t3_thread_list / t3_thread_read, or open it in the app.
Expected
The scheduler opens a fresh Scratch conversation in its own folder and runs the prompt, without requiring a Git repository.
Observed
The task is accepted with boundThreadId: null, but its new thread immediately fails with Workspace preparation failed:
Workspace preparation failed during provision worktree: Git command failed in GitWorkflowService.remoteExists (C:\Users\<user>\.t3\scratch): Failed to resolve the VCS driver for this Git command.
Durable run state confirms status: "failed", startedAt: null, and no assistant response. The thread was created at 03:14:17.205Z and failed at 03:14:17.673Z; the provider never started. The user's screenshot also shows the same error in the No project conversation.
run_scheduled_task_now and the task list report lastRunStatus: "succeeded" and runCount: 1 despite the failed thread. That result reflects successful dispatch/bookkeeping, as documented by the tool; it does not prove the provider ran.
Source corroboration
Read-only inspection of local main at 3143335fc3a568cbbb5174764961889272135cb9 (distinct from the running release version) confirms:
apps/server/src/mcp/OrchestratorMcpService.ts:230–235 assigns every unbound MCP task { type: "worktree", baseRef: "main", startFromOrigin: true }, without considering the Scratch target.
apps/server/src/scheduledTasks/ScheduledTaskService.ts:797–805 passes that stored strategy to threadLaunch.launch.
apps/server/src/orchestration-v2/ThreadLaunchService.ts:746–765 allocates a per-thread Scratch folder only for type: "root" launches.
This verifies the MCP entry path identified above. I did not exercise the settings editor or test the proposed root-mode workaround. PR #17257 is still open at the time of verification.
The temporary schedule was kept disabled throughout the reproduction and removed afterward; the failed thread was retained for inspection. No source changes were made.
Verification and report by GPT-6.1 Sol through the Codex harness in T3 Code.
Confirmed on T3 Code with no project attached. This reproduces with a generic scheduled task; its prompt/content does not matter.
Reproduction
Start from the projectless (“No project”) workspace.
Create a scheduled task that launches a fresh thread per run.
Prompt in fresh thread (also no project): "Run the task now."
Expected
The scheduled task should start without requiring a project or Git repository, or reject the configuration up front with a clear explanation.
Actual
The run fails during worktree preparation, before the agent starts:
Workspace preparation failed during provision worktree: Git command failed in GitWorkflowService.remoteExists (<scratch root>): Failed to resolve the VCS driver for this Git command.
The scheduler can still report the dispatch as successful even though the run never reaches the agent.
Activity
juliusmarminge commentedon Oct 8, 2026
Note
Grok responding on behalf of Julius.
Thanks for the report — this looks real on current
main(580948708).What happens
A scheduled task stores
workspaceStrategyon the row and, when unbound, launches with that strategy as-is (ScheduledTaskService.runTask→threadLaunch.launch, ~L798–805). The schedule editor defaults new tasks to Create a new worktree (EMPTY_DRAFT.workspaceMode: "worktree",ScheduledTasksSettings.tsx~L127) and still lists the Scratch project titled No project as an ordinary project (ManagedProjectFoldersbootstraps it with that title). There is no UI or upsert guard that forbids worktree/checkout modes for Scratch.At run time,
type: "worktree"always callsgit.createWorktreeagainstproject.workspaceRoot(ThreadLaunchService.prepareInBackground, ~L321–404). Scratch is not a git repo (ManagedProjectFolders.tsheader: Scratch is a plain folder with per-thread subfolders). That most likely fails and surfaces as Workspace preparation failed (failureDetail,ThreadLaunchService.ts~L165–171).The path that does work for No project is
type: "root": launch remaps Scratch root launches into a fresh per-thread folder viamanagedFolders.folderForThread(ThreadLaunchService.ts~L746–763).Open PR #17257
Web-only: adds an explicit No project choice, hides workspace/base-branch/checkout controls for that choice, and on save forces
{ type: "root" }viaworkspaceStrategyFromDraft(draft, noProject). That should stop new UI saves (and a re-save of an existing Scratch task) from storing worktree mode.It does not fully close this on its own:
worktreestrategy for Scratch / non-git cwd at upsert or run timeschedule_taskstill hard-codes unbound tasks to{ type: "worktree", baseRef: "main", startFromOrigin: true }(OrchestratorMcpService.scheduledTaskWorkspaceStrategy, ~L228–233) — same failure already noted on #16183Suggested fix
worktree/ invalid checkout strategies toroot(or reject with a clear error) on upsert and at launch, so existing tasks and MCP don’t keep failing.schedule_taskto pickrootfor Scratch / non-git projects (overlaps #16183).Workaround: edit the task → Workspace → Use the project checkout (root), then run again.
Related (same Scratch + git-worktree mismatch, different entry): #16183. Nearby No-project threads but different bugs: #17166, #17187.
I traced this on
mainonly — I did not run a scheduled task end-to-end.Alb11747 commentedon Oct 9, 2026
Confirmed end-to-end on T3 Code
0.0.46-nightly.20261008.2849, Windows x64, at 2026-10-09 03:14:17 UTC. This adds a live MCP reproduction to the source analysis above.Minimal reproduction
Start a conversation under No project (the managed Scratch project).
Call
schedule_taskfrom that conversation with:{ "title": "Repro: no-project scheduled fresh thread", "prompt": "Reply exactly SCHEDULER_REPRO_OK. Do not use tools or do any other work.", "schedule": { "type": "interval", "everyMs": 86400000 }, "bindToCurrentThread": false, "enabled": false }Call
run_scheduled_task_nowwith the returned task ID. The disabled schedule permits a manual run without leaving recurring work active.Inspect the newly created thread with
t3_thread_list/t3_thread_read, or open it in the app.Expected
The scheduler opens a fresh Scratch conversation in its own folder and runs the prompt, without requiring a Git repository.
Observed
The task is accepted with
boundThreadId: null, but its new thread immediately fails with Workspace preparation failed:Durable run state confirms
status: "failed",startedAt: null, and no assistant response. The thread was created at03:14:17.205Zand failed at03:14:17.673Z; the provider never started. The user's screenshot also shows the same error in the No project conversation.run_scheduled_task_nowand the task list reportlastRunStatus: "succeeded"andrunCount: 1despite the failed thread. That result reflects successful dispatch/bookkeeping, as documented by the tool; it does not prove the provider ran.Source corroboration
Read-only inspection of local
mainat3143335fc3a568cbbb5174764961889272135cb9(distinct from the running release version) confirms:apps/server/src/mcp/OrchestratorMcpService.ts:230–235assigns every unbound MCP task{ type: "worktree", baseRef: "main", startFromOrigin: true }, without considering the Scratch target.apps/server/src/scheduledTasks/ScheduledTaskService.ts:797–805passes that stored strategy tothreadLaunch.launch.apps/server/src/orchestration-v2/ThreadLaunchService.ts:746–765allocates a per-thread Scratch folder only fortype: "root"launches.This verifies the MCP entry path identified above. I did not exercise the settings editor or test the proposed root-mode workaround. PR #17257 is still open at the time of verification.
The temporary schedule was kept disabled throughout the reproduction and removed afterward; the failed thread was retained for inspection. No source changes were made.
Verification and report by GPT-6.1 Sol through the Codex harness in T3 Code.
manvankaliber commentedon Oct 17, 2026
Confirmed on T3 Code with no project attached. This reproduces with a generic scheduled task; its prompt/content does not matter.
Reproduction
Expected
The scheduled task should start without requiring a project or Git repository, or reject the configuration up front with a clear explanation.
Actual
The run fails during worktree preparation, before the agent starts:
The scheduler can still report the dispatch as successful even though the run never reaches the agent.