Repository navigation
[Bug]: VCS spawn error fires even with Git integration disabled and git not installed #10351
Description
Activity
Thanks for the thorough write-up and the source pointers — this checks out on current
main.What's going on
GitVcsDriver.isInsideWorkTreealways spawnsgit -C <cwd> rev-parse --is-inside-work-tree. Non-zero “not a repo” (exit 128) is already handled viaallowNonZeroExit: trueand becomesfalse. A missinggitbinary is a spawn failure (VcsProcessSpawnError) and is not treated as “not a repository,” so it bubbles out.Folder open hits that probe through VCS status (
VcsStatusBroadcaster→GitWorkflowService.detectGitRepositoryForStatus→VcsDriverRegistry.detect→detectRepository→isInsideWorkTree). The toast text matchesVcsProcessSpawnError.messageinpackages/contracts/src/vcs.ts.The Git switch is not an off switch
In Settings → Version Control, the Git control is a disabled availability indicator, not a user setting:
const enabled = item.status === "available" && item.implemented; <Switch checked={enabled} disabled aria-label={`${item.label} availability`} />
“Not available on this server” is
SourceControlDiscoverycorrectly reportingstatus: "missing"whengit --versionfails. There is nogit.enabled/vcs.enabledflag inServerSettings.VcsDriverRegistry.detectonly consults.t3code/vcs.json(VcsProjectConfig.resolveKind) and then always tries the git driver.So Git OFF here means “git not found,” not “do not spawn git.” Discovery already knows git is missing; detect does not use that result.
Contrast in-tree
RepositoryIdentityResolveralready treats a failedgit rev-parseas “no repo” (Effect.option→null).GitHubCli/AzureDevOpsCli/SourceControlDiscoverytreat a missing binary as unavailable.isInsideWorkTreedoes not, which is why installing Git makes the error disappear (spawn succeeds, then “not a repo” is silent).Not a duplicate of
- [BUG] ThreadSettlementReactor spawns ~50 git/min even when auto-settle is disabled; vcs.refreshStatus sits at 10s p50 #9714 — extra git work when a feature setting is off (same theme, different path)
- [Bug]: Repository identity and VCS detection spawn git per project on every read, stalling shellSnapshot #8949 / fix(server): keep git repository detection cached for minutes #8951 — detect cache TTL when git is installed
- [Bug]: Partial .git directory makes checkpoint reactor attempt VCS operations for a non-repository project #8873 — stale
.gitpath vs authoritative detect
No open PR covers this missing-binary case.
Suggested fix (minimal first)
- In
isInsideWorkTree(and ideallydetectRepository), mapVcsProcessSpawnErrorfor a missinggit(ENOENT/PlatformErrorNotFoundon spawn) tofalse/nullinstead of failing. That matches the other CLI “unavailable” handling and the reporter’s expected behavior. - Optional follow-up: short-circuit
VcsDriverRegistry.detectwhen discovery already marked gitmissing, so we don’t spawn at all. - A real user-facing “disable Git integration” setting would be a separate enhancement — it does not exist today.
Workaround remains: install Git, or live with the toast on folder open (fetch interval 0 does not stop the initial detect).
- addedvia-triageFiled through npx t3 triageFiled through npx t3 triagebugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.
on Sep 6, 2026 - added a commit that references this issue
on Sep 10, 2026
Before submitting
Area
apps/desktop
Steps to reproduce
giton PATH (verified:gitnot recognized; folder is not a repo, no.git).C:\Users\PC\Documents\newproject.Expected behavior
With Git integration disabled, the app should never attempt to spawn
git. And when thegitbinary is missing entirely, the worktree probe should fail silently instead of surfacing an error.Actual behavior
An error notification appears on every folder open:
So
isInsideWorkTreestill spawnsgitdespite the toggle being OFF, and a missing binary is reported as an error rather than handled gracefully.Regression: the previous build did not show this error; it appeared only after updating to this nightly.
Impact
Minor bug or occasional failure
Version or commit
0.0.39-nightly.20260906.1293
Environment
Windows 11, T3 Code desktop (Nightly),
gitnot installed, opened folder is not a git repository.Logs or stack traces
Screenshots, recordings, or supporting files
Workaround
Install Git (spawn then succeeds and the driver quietly reports "not a repo"),
or set Git fetch interval to 0 to reduce repeated background spawns
(the error on folder open remains).
Source hint
The probe is
git -C <cwd> rev-parse --is-inside-work-tree, and a missingbinary is surfaced as an error instead of "not a repository":
t3code/apps/server/src/vcs/GitVcsDriver.ts (~L275-285)
t3code/packages/contracts/src/vcs.ts (~L60-85)
t3code/apps/server/src/vcs/VcsDriverRegistry.ts (~L55-105)
Detection consults only
VcsProjectConfig.resolveKind(.t3code/vcs.jsonkind selector) —
ServerSettingshasautomaticGitFetchInterval,backgroundActivity,sourceControlWritingStyle, but nogit.enabled/vcs.enabledflag. Unconditional callers includeGitWorkflowService.detectGitRepositoryForStatus(
apps/server/src/git/GitWorkflowService.ts~L110-175) andVcsStatusBroadcaster.getStatus/refreshStatus(
apps/server/src/vcs/VcsStatusBroadcaster.ts~L200-280).As a result, with the desktop Git toggle OFF and no
giton PATH, everyfolder open / turn still spawns
gitand the ENOENT surfaces as anotification error.
Suggested fix
ProcessSpawnErrorwith ENOENT (binary missing) in theisInsideWorkTreepath as "not a repository" (returnfalse) insteadof raising
VcsProcessSpawnError.VcsDriverRegistry.detecton a real git-enabled setting wired tothe Version Control toggle, so OFF means zero git spawns.
(Line numbers from
mainas of 2026-09-06; the behavior was verified on0.0.39-nightly.20260906.1293.)