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.
Area
apps/server
Steps to reproduce
- Open a repository with
.gitmodules(e.g.rigortype/rigor, 13 submodules underreferences/, including large repositories such asruby/ruby,phpstan/phpstan,microsoft/TypeScript-Website,sorbet/sorbet) with defaultworktreeSubmodules("recursive"). - Launch a new worktree thread or delegated task (
delegate_taskwithisolation: "worktree"). GitVcsDriver.createWorktreerunsgit worktree add, thengit submodule init, thengit submodule update --init --recursivewithtimeoutMs: null.- Wait until
git submodule update --init --recursivefails (exitCode: 1after downloading/failing on submodules — in our traces, ~2 hours 9 minutes).
Expected behavior
- When
git submodule updatefails during worktree creation, T3 Code should not silently leave half-initialized submodule directories (.gitgitdir pointer only, empty working tree) that makegit statusandgit diffreport modified/dirty submodules across the worktree. - Either fail/roll back or report the failed submodule state cleanly rather than swallowing
GitCommandErroras a warning and handing a broken dirty worktree to the agent (which then blocks git tooling unless-c diff.ignoreSubmodules=allis passed). - Combined with [Bug]: New worktree creation reclones already-initialized submodule objects #9853 (recloning already-populated
.git/modulesfrom remote) and [Bug]: Automatic worktree submodule checkout can wait indefinitely and blocks /side #33017 (timeoutMs: null/ interactive auth env), large submodule sets should not blockpreparingfor hours.
Actual behavior
In T3 Code Beta 0.1.9 (24e77473ecf4), GitVcsDriver.createWorktree completes git worktree add in under a second (~740–790 ms), then blocks on GitVcsDriver.createWorktree.updateSubmodules (git submodule update --init --recursive, timeoutMs: null) for over 2 hours.
When updateSubmodules exits with exitCode: 1, createWorktree logs:
worktree submodule checkout failed; submodules may be incomplete
and returns Success. On disk, 12 submodules are left containing only a .git file (gitdir: .../worktrees/<id>/modules/...) with empty working trees, while git status --short marks all 12 as dirty ( M references/... / m references/...). Any subsequent script or agent step that checks for a clean diff or runs git diff fails unless submodules are explicitly ignored.
Impact
Major degradation or frequent failure
Version or commit
0.1.9 (commit 24e7747)
Environment
macOS (arm64), T3 Code Beta 0.1.9 (24e77473ecf4), Git 2.56.1
Logs or stack traces
From server.trace.ndjson:
{
"name": "GitVcsDriver.createWorktree.updateSubmodules",
"durationMs": 7768571.266084,
"attributes": {
"git.operation": "GitVcsDriver.createWorktree.updateSubmodules",
"git.args_count": 4
},
"exit": { "_tag": "Success" }
}{
"name": "createWorktree",
"durationMs": 7769359.464166,
"events": [
{
"name": "[\"worktree submodule checkout failed; submodules may be incomplete\", {\"cause\": {\"_tag\": \"GitCommandError\", \"operation\": \"GitVcsDriver.createWorktree.updateSubmodules\", \"command\": \"git\", \"argumentCount\": 4, \"exitCode\": 1, \"stdoutLength\": 0, \"stderrLength\": 2258, \"detail\": \"Git command exited with a non-zero status.\"}}]"
}
],
"exit": { "_tag": "Success" }
}Resulting git status --short in the created worktree:
M references/TypeScript-Website
M references/elixir-lang.github.com
M references/ex_doc
M references/hanakai-rb
M references/python-typing
M references/rbs
m references/rbs-inline-wiki
M references/ruby
M references/sorbet
M references/steep
M references/tapioca
M references/typeprof
(Same failure also occurred on a second worktree on the same repo: updateSubmodules 7,716,565 ms -> exitCode: 1; a third worktree remained stuck in preparing for 5,823,310 ms before manual cancellation.)
Related issues
- [Bug]: New worktree creation reclones already-initialized submodule objects #9853 (recloning already-initialized submodule objects; PR fix(server): new worktrees borrow submodule objects from the source checkout #23269)
- [Bug]: Automatic worktree submodule checkout can wait indefinitely and blocks /side #33017 (
timeoutMs: null& missing non-interactive credential env inupdateSubmodules)
Workaround
Set worktreeSubmodules to "none" in T3 Code project settings (or projectSettingsOverrides.<projectId>.worktreeSubmodules = "none" in settings.json, or in t3.json), which skips submodule init / submodule update during worktree creation.
Activity