GeezerVison is showing github.com — fix(server): repositories whose folder name ends in a space keep that space in their root path by only21mil · Pull Request #41666 · pingdotgg/t3code
Conversation
Problem
GitVcsDriver.detectRepository reads the repository root and Git common dir from git rev-parse and calls .trim() on each path. On Linux and macOS a folder name can end in a space, a non-breaking space or a carriage return, and .trim() removes it, so rootPath names a folder that does not exist. Two server checks then go wrong for such a checkout:
GitWorkflowService.withCheckoutLease takes its workspace lease on realPath(rootPath), falling back to the path itself. The trimmed path has no real path, so branch switches, branch creation, commit/push actions and local PR checkouts take a different lease than turn starts, checkpoint rollback, storage cleanup and terminals, which lease the real folder. They no longer wait for each other.
assertCheckoutIdle looks for projects nested under the root with startsWith(${root}/), which misses every nested project, so a busy thread in one does not block a branch switch.
RepositoryIdentityResolver (#35767) and GitVcsDriverCore's common-dir reader already remove only Git's final newline.
Change
detectRepository now removes only Git's final LF from the two path lines, in both the one-spawn answer and the per-path fallback used when a path holds a newline, and splits on LF alone. Git ends these lines with LF on every platform, so a CR before it belongs to the path, as in GitVcsDriverCore's layout read. The --is-inside-work-tree line is still trimmed, and an empty common dir still maps to null. One test is added to GitVcsDriver.test.ts.
Verification
An AI agent ran each check on Linux with no accounts.
Setup: Linux x86_64, Node 26.13.1, git 2.53.0, a throwaway repository in a temp folder named project (trailing space).
Steps: a small script that calls the real VcsDriverRegistry.detect on that folder, computes the checkout lease key the way withCheckoutLease does, and runs git -C <rootPath> status.
|
18d5eda8819f (main) |
a757dbd93abb (this PR) |
rootPath |
…/project (does not exist) |
…/project |
| Checkout lease key matches turn-start key |
no |
yes |
Nested pkg project found under root |
no |
yes |
git -C <rootPath> status |
exit 128, cannot change to '…/project' |
exit 0 |
vp test run src/vcs/GitVcsDriver.test.ts: the new case covers roots ending in a space and in a carriage return, with common dirs ending in U+00A0, through both the one-spawn answer and the newline fallback. It fails on main (expected '…/repo' to equal '…/repo ') and passes here. Restoring the old CR-tolerant split, or .trim() on the fallback root alone, also fails it.
vp run check:changed: passes.
Generated with Claude Opus 5.5 in T3 Code Nightly
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
… space in their root path
coderabbitai
Bot
commented
Nov 23, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
detectRepository now preserves whitespace and carriage returns in Git-reported paths. A new test checks detection of working-directory paths with trailing spaces, carriage returns, or embedded newlines, and metadata paths ending in a nonbreaking space.
Changes: Repository path parsing
| Layer / File(s) |
Summary |
Parse and test repository paths apps/server/src/vcs/GitVcsDriver.ts, apps/server/src/vcs/GitVcsDriver.test.ts |
detectRepository removes only a trailing LF from Git output and no longer trims parsed paths. The added test checks detection of paths containing whitespace and carriage returns. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: juliusmarminge
Merge Risk: Minimal · up to d1b19
-
Repository detection now keeps trailing spaces and carriage returns in folder names, so paths match the real directory. The change is small and tested, and no merge-blocking risk remains.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the actual change: detectRepository keeps trailing spaces in repository root paths on Linux and macOS, which the raw summary and objectives both confirm. It follows the conventional co… |
| Description check |
 |
The description covers the problem, the change, verification, and scope context. It explains the bug with reproduction steps on Linux, the fix in detectRepository, and a test. It names the agent and m… |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title names the actual change: detectRepository keeps trailing spaces in repository root paths on Linux and macOS, which the raw summary and objectives both confirm. It follows the conventional commit form and is specific enough for a teammate scanning history. It is a bit long at 94 characters, but this does not affect the verdict.
Full details: Description check
-
Explanation
The description covers the problem, the change, verification, and scope context. It explains the bug with reproduction steps on Linux, the fix in detectRepository, and a test. It names the agent and model used, as the template asks. The Scope section does not link an issue, but it cites the related PR #35767 and says the fix matches existing behavior in GitVcsDriverCore and RepositoryIdentityResolver, which partly covers the bug-justification need. Verification is detailed and lists the commands and results, and it notes that the author ran check:changed. It does not state anything unverified, so the check passes.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between a757dbd and d1b190e.
Files selected for processing: 1
-
apps/server/src/vcs/GitVcsDriver.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Evidence
Real web app, Chromium, light theme, 1440×1000; fresh database on each commit. Created project with committed pkg and other subfolders and branches main/feature. Added both subfolders as projects, left a Replay question turn busy in pkg, completed a showcase turn in other, then selected feature from the idle thread's Branch picker.
Proven: base switches the shared checkout under the busy sibling; head refuses the switch and preserves main. scenarios:prove exited 0.
Scenario driver
Not shown:
- The separate checkout lease-key effect was not directly observed; this proof demonstrates the busy nested-project guard.
- Other whitespace characters, separate Git metadata directories, and newline-path fallback behavior were outside this reproduction.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:S
10-29 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|