Skip to content
Source
Sign inSign up
pingdotgg/t3code

Scheduled tasks that launch a fresh thread always save a worktree workspace strategy, so every run fails in non-git projects #18615

Closedcrispearson(GitHub profile, opens in a new tab) opened this issue 1 comment

Version: T3 Code Nightly 0.0.46-nightly.20261010.2922, macOS 15 (Darwin 24.6.0), Intel Mac mini

What happens

A scheduled task with bindToCurrentThread: false (a fresh thread per run), created in a project whose folder is not a git repo, fails every run before the agent starts:

Workspace preparation failed during provision worktree: Git command failed in GitWorkflowService.remoteExists (<project root>): Failed to resolve the VCS driver for this Git command.

Cause, as far as I can tell

schedule_task stores workspace_strategy_json = {"type":"worktree","baseRef":"main","startFromOrigin":true} on the task, whatever the project is:

  • the project folder isn't a git repository,
  • the project's defaultThreadEnvMode is "local" (I set it before recreating the task, and the recreated task still saved worktree).

update_scheduled_task has no field to change the workspace strategy, so the only workarounds are binding the task to an existing thread or moving the job into a git project.

Steps to reproduce

  1. Register a project whose root is a plain folder (no .git).
  2. Optionally set the project's defaultThreadEnvMode to local.
  3. Create a scheduled task in it with bindToCurrentThread: false.
  4. Run it (run_scheduled_task_now, or wait for the trigger).
  5. The new thread fails at workspace preparation.

Expected

  • A fresh-thread scheduled task in a non-git project runs in the project root (local), or
  • it follows the project's defaultThreadEnvMode, and
  • creating it in a non-git project with a worktree strategy is rejected up front rather than failing on every run.

Nice to have: a workspaceStrategy field on schedule_task / update_scheduled_task, like t3_thread_launch has.

Also noticed

lastRunStatus reports succeeded for runs whose thread failed at workspace preparation, so the failure doesn't show in list_scheduled_tasks.

  1. Note

    Grok responding on behalf of Julius.

    Closing as a duplicate of #16183.

    Same root cause: schedule_task always stores workspace_strategy_json as {type:"worktree", baseRef:"main", startFromOrigin:true} for unbound / fresh-thread tasks, and update_scheduled_task cannot change it. #16183 already covers that hard-coded strategy (repos without main), and it already notes the non-git failure with the same Failed to resolve the VCS driver error; a follow-up comment there also documents the Scratch / no-project case.

    Please continue on #16183. Related open work: #16215 (default-branch fix for git projects), #17451 (Scratch coercion to root; ordinary non-git project folders still out of scope there). The misleading lastRunStatus: succeeded on failed workspace prep is also already tracked on #16183 / #17889.

  2. juliusmarminge added labelsduplicate

  3. juliusmarminge closed this

Sign in to join this conversation.