Skip to content

fix(server): opening a folder without Git installed no longer shows a spawn error - #14942

Merged
juliusmarminge merged 7 commits into
pingdotgg:mainfrom
tiliakoos:fix/10351-missing-git-detection
Oct 20, 2026
Merged

juliusmarminge merged 7 commits into
pingdotgg:mainfrom
tiliakoos:fix/10351-missing-git-detection

Conversation

@tiliakoos

@tiliakoos tiliakoos commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

When Git is not installed, opening a folder can fail repository detection with a spawn error instead of treating the folder as having no repository.

Map only the existing shared missing-executable condition to false in the Git worktree probe; detectRepository then returns null. Other spawn failures still propagate. Merged current main and preserved @tiliakoos's commits from #14942. The author had already migrated the old lowercase HostProcess import; the maintainer rebuild makes the missing-command fixture deterministic and checks both detection entry points.

Scope and approval: the missing-Git portion of #10351, explicitly selected for this maintainer batch. Maintainer triage separates this minimal fix from a future Git-disable setting. This does not implement that separate enhancement or claim to close the entire issue.

Verification on headless Linux:

  • PR-specific tests: 2 → 2. Existing GitVcsDriver.test.ts: 62 → 62 passing. Real subprocess coverage checks missing executable → false/null and a non-executable file → propagated spawn errors. Removing the catch reproduces the missing-executable failure; restoring it passes again.
  • Scoped server typecheck, targeted lint/format, and whitespace checks pass. Typecheck suggestions are outside the changed files.
  • One independent full-diff review round with Claude Opus 5.5 and Codex GPT-6-Sol: no code blockers.
  • Actual isolated server and web app: injected a Node subprocess hook that redirects Git launches to a nonexistent executable. Opened a disposable folder. The baseline left Git status controls disabled; the reviewed head loads the normal nonrepository state with “Initialize Git” and no error notification. Both captures use the same folder and 1280×800 viewport. The original toast was not reproduced in the current baseline UI; the focused regression confirms the underlying spawn failure.
  • This is runtime fault injection on a machine where Git is installed, not a Git-uninstalled OS image. macOS, Windows, iOS, Android, Electron desktop, relay/tunnel connections, and successful Git initialization were not verified.

Before (left) and after (right): folder opening while Git is unavailable

Implementation: Codex GPT-6.1-Sol in T3 Code; tests: Codex GPT-6-Astra; adversarial review: Claude Opus 5.5 and Codex GPT-6-Sol, through Codex/Claude harnesses.

… spawn error

Repository detection now reads a missing git executable as "not a repository",
like git's own exit 128, instead of surfacing the spawn error to the client.
Copilot AI balanced review requested due to automatic review settings October 3, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Oct 3, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 3, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at dd88142

Macroscope's review found this PR approvable — This is a focused Git detection bug fix: a missing Git executable is treated as “not a repository,” while unrelated process failures still propagate. The added regression tests verify both behaviors without changing production defaults or static-analysis configuration.

You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 3, 2026 — with ChatGPT Codex Connector
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 3, 2026 00:14

Dismissing prior approval to re-evaluate 6791b91

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 16b41925-94de-4766-a1ee-91266c1b61c2
📥 Commits

Reviewing files that changed from the base of the PR and between 3fa4f4c and dd88142.

📒 Files selected for processing: 2
  • apps/server/src/vcs/GitVcsDriver.test.ts
  • apps/server/src/vcs/GitVcsDriver.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 939bec13-3ca9-4b61-a55a-00e2300cf1e4
📥 Commits

Reviewing files that changed from the base of the PR and between 6791b91 and 3fa4f4c.

📒 Files selected for processing: 2
  • apps/server/src/vcs/GitVcsDriver.test.ts
  • apps/server/src/vcs/GitVcsDriver.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

📝 Walkthrough

The worktree probe treats a missing Git executable as not being inside a worktree. Other spawn failures retain their existing behavior. Tests cover missing and unspawnable executables.

Changes: Git executable detection

Layer / File(s) Summary
Missing-executable handling and tests
apps/server/src/vcs/GitVcsDriver.ts, apps/server/src/vcs/GitVcsDriver.test.ts
isInsideWorkTree returns false when Git spawning fails because the executable is missing. Tests check that repository detection returns null in this case and that other spawn failures still raise VcsProcessSpawnError.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 3fa4f

The change appears ready to merge after normal checks: opening a folder without Git should no longer surface the missing-executable error, while other spawn failures remain errors.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Linked Issues check Warning Issue #10351 requires both silent handling of a missing Git executable and no Git spawn when Git integration is disabled. GitVcsDriver.isInsideWorkTree now catches isMissingExecutable and returns … Add a Git/VCS enabled setting that uses the Version Control toggle. Make repository detection and its relevant callers skip Git process creation when the setting is disabled. Add automated coverage that verifies zero Git spawns in that stat…
Passed Passed checks: 3 passed
Check name Status Explanation
Out of Scope Changes check Passed The production change handles the missing Git executable in GitVcsDriver.isInsideWorkTree. The tests cover the requested missing-executable behavior and preserve errors for other spawn failures. The…
Title check Passed The title clearly and concisely describes the primary change: preventing a spawn error when Git is unavailable while opening a folder.
Description check Passed The description explains the problem, implementation, scope, approval, focused verification, limitations, and tooling used. It provides sufficient detail even though some template sections are written…
Full details: Out of Scope Changes check

Explanation

The production change handles the missing Git executable in GitVcsDriver.isInsideWorkTree. The tests cover the requested missing-executable behavior and preserve errors for other spawn failures. These changes support issue #10351 and show no unrelated changes.

Full details: Description check

Explanation

The description explains the problem, implementation, scope, approval, focused verification, limitations, and tooling used. It provides sufficient detail even though some template sections are written as labeled paragraphs instead of exact Markdown headings.

Full details: Linked Issues check

Explanation

Issue #10351 requires both silent handling of a missing Git executable and no Git spawn when Git integration is disabled. GitVcsDriver.isInsideWorkTree now catches isMissingExecutable and returns false. The new tests cover the missing executable and preserve other spawn errors. VcsDriverRegistry.detect still resolves and probes the Git driver without a disabled-integration gate, and no zero-spawn test was added. The disabled-integration requirement remains unmet.

Resolution

Add a Git/VCS enabled setting that uses the Version Control toggle. Make repository detection and its relevant callers skip Git process creation when the setting is disabled. Add automated coverage that verifies zero Git spawns in that state. Keep the existing missing-executable handling and spawn-error coverage.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Comment @coderabbitai help to get the list of available commands.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 3, 2026
…it-detection

# Conflicts:
#	apps/server/src/vcs/GitVcsDriver.ts
source-control-core exports isMissingExecutable since pingdotgg#19692, so the driver no longer carries its own copy of the predicate.
@tiliakoos

Copy link
Copy Markdown
Contributor Author

Merged upstream/main at 6a6ebb278d (08ede07), no conflicts; the test's HostProcessPlatform import followed the module to @t3tools/shared/HostProcess. 3fa4f4c then drops the driver's own predicate for isMissingExecutable, which #19692 added to source-control-core and discovery already uses for a missing hosting CLI. Both test files (67 passed), lint, format and the server typecheck were rerun on the merged branch; the missing-git case fails with the catch removed, and the permission case fails with the catch widened to every spawn error. The manual no-Git run was not retaken. The body is updated.

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 18, 2026 04:59

Dismissing prior approval to re-evaluate 3fa4f4c

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Oct 18, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 18, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Taking over this one as maintainer for batch worktree-git-02. I will preserve the focused fix, rebuild against current main, and refresh tests, review, and verification.

@juliusmarminge

Copy link
Copy Markdown
Member

The linked-issue warning asks for a Git-disable setting, which is outside this focused takeover. Maintainer triage explicitly identifies that as a separate enhancement: the current Git switch is an availability indicator. This PR covers the missing-executable detection path only. I changed the description to a related-issue reference and documented that limit; no new setting is added.

@macroscopeapp
macroscopeapp Bot dismissed their stale review October 19, 2026 05:56

Dismissing prior approval to re-evaluate b1efc9e

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 19, 2026
# Conflicts:
#	apps/server/src/vcs/GitVcsDriver.ts
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 20, 2026 04:06

Dismissing prior approval to re-evaluate dd88142

@juliusmarminge
juliusmarminge merged commit ce87dc7 into pingdotgg:main Oct 20, 2026
30 checks passed
@tiliakoos
tiliakoos deleted the fix/10351-missing-git-detection branch October 20, 2026 13:37
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Oct 21, 2026
… spawn error (pingdotgg#14942)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit ce87dc7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants