[Bug]: VCS spawn error fires even with Git integration disabled and git not installed
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
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/desktop
Steps to reproduce
- On Windows with no
giton PATH (verified:gitnot recognized; folder is not a repo, no.git). - Open any plain folder, e.g.
C:\Users\PC\Documents\newproject. - Go to Settings → Version Control → toggle Git OFF (shows "Not available on this server").
- Reopen the folder.
Expected behavior
With Git integration disabled, the app should never attempt to spawn git. And when the git binary is missing entirely, the worktree probe should fail silently instead of surfacing an error.
Actual behavior
An error notification appears on every folder open:
VCS process failed to spawn in GitVcsDriver.isInsideWorkTree: git (C:\Users\PC\Documents\newproject)
So isInsideWorkTree still spawns git despite 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), git not installed, opened folder is not a git repository.
Logs or stack traces
VCS process failed to spawn in GitVcsDriver.isInsideWorkTree: git (C:\Users\PC\Documents\newproject)
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 missing
binary is surfaced as an error instead of "not a repository":
t3code/apps/server/src/vcs/GitVcsDriver.ts (~L275-285)
const isInsideWorkTree = (cwd) =>
gitCommand(vcsProcess, "GitVcsDriver.isInsideWorkTree", cwd,
["rev-parse", "--is-inside-work-tree"],
{ allowNonZeroExit: true, timeoutMs: 5_000, maxOutputBytes: 4_096 },
).pipe(Effect.map((r) => r.exitCode === 0 && r.stdout.trim() === "true"));
t3code/packages/contracts/src/vcs.ts (~L60-85)
export class VcsProcessSpawnError ... {
override get message(): string {
return `VCS process failed to spawn in ${this.operation}: ${this.command} (${this.cwd})`;
t3code/apps/server/src/vcs/VcsDriverRegistry.ts (~L55-105)
const git = yield* GitVcsDriver.makeVcsDriver;
...
return yield* detectWithDriver("git", git, input.cwd); // -> detectRepository -> isInsideWorkTree
Detection consults only VcsProjectConfig.resolveKind (.t3code/vcs.json
kind selector) — ServerSettings has automaticGitFetchInterval,
backgroundActivity, sourceControlWritingStyle, but no git.enabled /
vcs.enabled flag. Unconditional callers include
GitWorkflowService.detectGitRepositoryForStatus
(apps/server/src/git/GitWorkflowService.ts ~L110-175) and
VcsStatusBroadcaster.getStatus/refreshStatus
(apps/server/src/vcs/VcsStatusBroadcaster.ts ~L200-280).
As a result, with the desktop Git toggle OFF and no git on PATH, every
folder open / turn still spawns git and the ENOENT surfaces as a
notification error.
Suggested fix
- Treat
ProcessSpawnErrorwith ENOENT (binary missing) in the
isInsideWorkTreepath as "not a repository" (returnfalse) instead
of raisingVcsProcessSpawnError. - Gate
VcsDriverRegistry.detecton a real git-enabled setting wired to
the Version Control toggle, so OFF means zero git spawns.
(Line numbers from main as of 2026-09-06; the behavior was verified on
0.0.39-nightly.20260906.1293.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/server/src/vcs/GitVcsDriver.ts around isInsideWorkTree, then trace VcsDriverRegistry.detect and the Version Control toggle through VcsProjectConfig and ServerSettings. Check the callers in GitWorkflowService.ts and VcsStatusBroadcaster.ts; done means Git is not spawned when disabled and a missing binary does not surface an error while repository detection still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- backend, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 67/100