Independent confirmation from a fork running Git 2.56.0 on Linux: storage cleanup tripped over the same gitfile does not point to a valid repository stderr for a removed worktree, and we have carried a one-line patch for it since 2026-10-11 that adds this message to the check in storageCleanup.ts. That is one of the call sites this PR fixes; the shared isNonRepositoryGitStderr covers it along with the others, so we will drop our patch once this lands.
fix(server): Git 2.56 errors for a broken .git file count as not a repository#26359
๐ค Git 2.56 (git/git@ed5d4f6e89) reports a .git file that points to a missing folder as "gitfile does not point to a valid repository" instead of "not a git repository", so storage cleanup reports such a removed worktree as failed and GitManager and GitVcsDriverCore do not treat it as "not a repository". isNonRepositoryGitStderr now knows both messages, and GitManager and storageCleanup use it instead of their own copies of the old check. The new test in GitVcsDriverCore.test.ts fails on main and passes with the fix; storageCleanup.test.ts > "compares the checked-out branch without a full status" failed 3 of 3 runs with a Git 2.56.0 build on main and passed 25 of 25 with the same check in our fork.
Full status refresh also applies the shared matcher when reading the current branch, with LC_ALL=C for stable diagnostics. The existing workflow test covers healthy branches, detached HEAD, and a broken gitfile through real Git.
Verified in a running Linux dev app with Git 2.56.0, real Codex turns, and French diagnostics. Blacksmith vp run check:changed passed 416 tests and all scoped checks.
main: broken worktree cleanup fails
pr: the same broken worktree is kept safely
running app: delete now and inspect the kept-worktree result
nearby behavior: clean settled worktree removed with branch and commits preserved
Model: gpt-6.1-sol. Harness: Codex through T3 Code.
Checks
Added 1 commit
- fix(server): Git 2.56 errors for a broken .git file count as not a repository38f324f
Added 2 commits
Note
Written by gpt-6.1-sol on behalf of Maria
merged current main (61c3794c32) without rebasing, preserving both sides. main already contains the fix for the previously failing Astro lint-argument assertion, so no unrelated fix was added. the pr remains six files, 54 additions and 8 deletions.
verified head: 80f626f438d68e8d4f433a7e9409a14be3361243. blacksmith vp run check:changed github/main passed format, lint, both knip passes, graphql, typechecks for three packages, and all 506 tests in five files. the exact previously failing file, vp test run scripts/check-changed.test.ts, also passed all 15 tests. two independent reviewers approved this head with no blocker or should-fix findings. github confirms no merge conflicts.
ci is blocked on workflow approval: six workflows, including CI, concluded action_required before creating any jobs. this is not a green-ci result. stopped at the human approval gate.
this pass only merged main. real git 2.56 client/provider evidence remains in the existing verification comment; that integration was not repeated this pass. native clients, other platforms, and remote connections remain unverified.
Added 2 commits
Note
Written by gpt-6.1-sol on behalf of Maria
Verified in a real dev environment
verified on linux with real git 2.56.0, the dev web client driven by repo playwright and /usr/bin/google-chrome, and three real codex gpt-6.1-sol turns. the project, worktree, threads, files and commits were created through the app/provider flow. no mocks or demo data.
- on
github/main(6575ce3250), a broken worktree.gitpointer made settings > maintenance > delete now report1 failedwithgitfile does not point to a valid repository. - on this pr, the same thread/worktree reports
1 kept,repository or branch changed, and zero failures. - real verification found a missing caller: full status refresh still failed in
GitWorkflowService.currentBranch.4612bc1514applies the shared matcher there;fe846355e7forces english diagnostics. the extended existing real-git test failed before the fix and passed after it. - rebuilt git with translations and restarted the dev server with
LANGUAGE=fr,LC_ALL=en_US.utf8. direct git emitted the french diagnostic; full websocket status refresh returnedisRepo: false, and cleanup kept the broken worktree without failure. restoring its pointer restored correct branch/status reporting. - cleanup preserved the provider-created untracked file, respected settle grace and an open provider session, then removed the clean eligible worktree after the session closed. it recovered 12 kb and preserved the branch and both commits.
final head: fe846355e7b1199123783ab7551324aa3ed5cf9e. blacksmith vp run check:changed passed format, lint, both knip passes, graphql, typechecks for 3 packages, and 416 tests in 5 files. two independent reviewers approved this head. all github checks are green on this head.
main: broken worktree cleanup fails
pr: the same broken worktree is kept safely
running app: delete now and inspect the kept-worktree result
nearby behavior: clean settled worktree removed with branch and commits preserved
Not verified
native electron, ios/android, macos/windows, other providers, and remote/relay/tunnel connections were not exercised on this linux vm. verification covers the local web client, real codex provider and running server. uploaded video playback and seeking were checked in chrome.
Added 4 commits
Thanks, Yarden-zamir, for the earlier diagnosis and fix, and for the thorough verification. Closing in favor of #33423 by Ali-Al1: this PR now conflicts with current main, while that focused fix applies cleanly. The additional full-status branch lookup handling here is not in that PR; if it still matters, please consider a small follow-up for it.