pingdotgg / pingdotgg/t3code

[Bug]: VCS spawn error fires even with Git integration disabled and git not installed

Open
#10,351 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug via-triage
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
  1. On Windows with no git on PATH (verified: git not recognized; folder is not a repo, no .git).
  2. Open any plain folder, e.g. C:\Users\PC\Documents\newproject.
  3. Go to Settings → Version Control → toggle Git OFF (shows "Not available on this server").
  4. 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
Image Image
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
  1. Treat ProcessSpawnError with ENOENT (binary missing) in the
    isInsideWorkTree path as "not a repository" (return false) instead
    of raising VcsProcessSpawnError.
  2. Gate VcsDriverRegistry.detect on 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.