Replies: 1 comment
|
+1 on this one. For example I don't have the |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Before submitting
Area
apps/server
Problem or use case
A project action with
runOnWorktreeCreate: trueis started after the worktree is created, but T3 Code launches the first agent turn immediately after writing the setup command to its terminal.The agent can therefore begin inspecting or modifying the worktree while the setup script is still:
This creates a race condition. For example, an agent may report that a repository or generated file is missing simply because setup has not cloned or generated it yet. In a monorepo, the agent can also run package-manager or Git commands against a partially initialized workspace.
I reproduced this with T3 Code 0.0.31. The current
ProjectSetupScriptRunnerreturnsstatus: "started"after opening the terminal and writing the command; the first provider turn is then dispatched without observing the setup command's completion.Proposed solution
Add an opt-in blocking mode for automatic worktree setup actions. The exact property name is flexible, but conceptually:
{ "name": "Set up worktree", "command": "bash scripts/setup-worktree.sh", "runOnWorktreeCreate": true, "waitForCompletion": true }When enabled, T3 Code would:
The failure state could offer "Retry setup" and "Continue anyway" actions.
The existing non-blocking behavior could remain the default when the new option is absent, preserving compatibility.
Why this matters
Worktree setup commonly establishes files, repositories, dependencies, and services that the agent assumes exist when interpreting the task.
Blocking the first turn until setup succeeds would make new worktrees deterministic and prevent agents from reasoning about or modifying partially initialized workspaces. This is particularly important for monorepos and projects whose setup takes more than a few seconds.
Smallest useful scope
The smallest useful implementation would support one automatic setup action that:
Retry controls, configurable timeouts, and multiple blocking actions could come later.
Alternatives considered
post-checkouthook: This blocksgit worktree add, but its output is currently difficult to observe in T3 Code and it runs outside the project-action lifecycle. Related: feat: Surface post-checkout hook output during worktree creation #551.&& exitto the setup command: This closes the successful setup terminal, but it does not prevent the agent from starting while setup is running.Risks or tradeoffs
Examples or references
Related but distinct issues:
post-checkouthook outputt3.jsonsetup actions without per-user importCurrent setup runner:
https://github.com/pingdotgg/t3code/blob/main/apps/server/src/project/ProjectSetupScriptRunner.ts
Contribution
All reactions