You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git accepts userless SCP-style remotes with repeated slashes in the path, such as buildbox:/srv//git/repo.git or buildbox:/srv/git/repo.git//, and connects to them over SSH. T3 Code reports no host for these remotes and does not treat them as SSH. userlessScpRemoteHost required exactly one slash between path segments and allowed at most one trailing slash. As a result, isSshRemoteUrl returned false, so RepositoryIdentityResolver skipped its SSH alias lookup, and parseGitRemoteHost fell back to URL parsing and returned null.
Deterministic repro on origin/main (d1a1ede52b02a7e346c3a6b212f013e20d176c9a): run the self-contained repro.sh <checkout> script from the evidence gist. It builds a scratch bare repo in a temp dir and sets its own Git identity with GIT_CONFIG_GLOBAL=/dev/null. It then sets origin to buildbox:<scratch>/srv//git/repo.git and to buildbox:<scratch>/srv/git/repo.git//, and runs GIT_SSH_VARIANT=ssh GIT_SSH=<stub> git ls-remote origin for each. The stub runs only its last argument through sh -c. Finally it probes the configured origins with node -e from apps/server, so nothing is written into the checkout.
Observed: Git calls git-upload-pack with each path unchanged and lists refs. For both origins, userlessScpRemoteHost returns null, isSshRemoteUrl returns false and parseGitRemoteHost returns null. The controls buildbox:/srv/git/repo.git and git@buildbox:/srv//git/repo.git resolve to buildbox.
Expected: buildbox, true and buildbox for both origins.
Change
The userless SCP pattern now allows a run of slashes between nonempty path segments (\/ → \/+) and a run of trailing slashes (\/?$ → \/*$). The host rule, the single-letter Windows drive guard, the :: remote-helper guard and the optional leading slash are unchanged. isSshRemoteUrl and parseGitRemoteHost both call this function, so source-control provider recognition and server repository identity detection are fixed together.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/shared/src/sourceControl.test.ts: added the interior and trailing repeated-slash remotes to the positive isSshRemoteUrl cases and to a new userlessScpRemoteHost case. With base source, the 4 new cases fail (expected false to be true, expected null to be 'buildbox'). On head, all 22 tests pass, including the existing negative controls (hg::owner/repo, C:repo.git, C:/repos/repo, /srv/git/repo.git, file:///…, https://…).
parseGitRemoteHost consumer tests pass: source-control-githubdefinition.test.ts (14) and source-control-gitlabgitLabDiscovery.test.ts (9).
commit-checked.sh ran vp run check:changed on the tree committed as 894a44f29f3 and exited 0 (format, lint, knip, typecheck for 38 packages, affected tests). The gist includes its summary.
Not shown: a connection to a real SSH host (the local stub stands in for ssh), and an end-to-end run of RepositoryIdentityResolver's alias lookup in the running app.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Macroscope's review found this PR approvable — Recognizes userless SSH remotes containing repeated internal or trailing path slashes. The change is limited to URL classification and reuses existing SSH handling without changing product defaults.
Notes:
All code in this push has already been reviewed. Approvability was decided on eligibility alone.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between bb17157 and 95d4f41.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The userless SCP-style SSH remote pattern now accepts repeated slashes between path segments and at the end of a URL. Tests cover SSH detection and buildbox host extraction for these URLs.
Changes: SCP Remote Slash Handling
Layer / File(s)
Summary
Matcher and test coverage packages/shared/src/sourceControl.ts, packages/shared/src/sourceControl.test.ts
The userless SCP-style remote pattern accepts repeated separators and trailing slashes. Tests verify SSH detection and buildbox host extraction.
pingdotgg/t3code#29457: Adds userlessScpRemoteHost and uses it for remote host parsing and SSH detection, which this change updates.
Suggested reviewers:only21mil
Merge Risk: Minimal · previous review bb171
This change lets Git remotes like buildbox:/srv//git/repo.git be recognized as SSH remotes and have their host parsed. It is narrowly scoped and tested, and no concrete merge-blocking risk is evident.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the userless SSH remote matcher now accepts repeated path slashes. It is a conventional commit with a specific scope, and it matches the code change and the PR objecti…
Description check
The description covers the template sections. Problem gives the bug, the expected behavior and a deterministic repro. Change explains the regex edits and why both consumers are fixed together. Scope e…
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 main change: the userless SSH remote matcher now accepts repeated path slashes. It is a conventional commit with a specific scope, and it matches the code change and the PR objectives.
Full details: Description check
Explanation
The description covers the template sections. Problem gives the bug, the expected behavior and a deterministic repro. Change explains the regex edits and why both consumers are fixed together. Scope explains why no issue is needed for a small fix. Verification lists focused tests, consumer tests, the check run, and a before/after transcript, and it states what was not checked. The template's agent-model line is present. The description also includes a claim that the PR was authored by a named model, which the template asks for, so it is not a defect.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between a6516fb and bb17157.
Files selected for processing: 2
packages/shared/src/sourceControl.test.ts
packages/shared/src/sourceControl.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).takeover:in-progressA takeover lead is working on this PRvouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
Git accepts userless SCP-style remotes with repeated slashes in the path, such as
buildbox:/srv//git/repo.gitorbuildbox:/srv/git/repo.git//, and connects to them over SSH. T3 Code reports no host for these remotes and does not treat them as SSH.userlessScpRemoteHostrequired exactly one slash between path segments and allowed at most one trailing slash. As a result,isSshRemoteUrlreturned false, soRepositoryIdentityResolverskipped its SSH alias lookup, andparseGitRemoteHostfell back to URL parsing and returned null.Deterministic repro on
origin/main(d1a1ede52b02a7e346c3a6b212f013e20d176c9a): run the self-containedrepro.sh <checkout>script from the evidence gist. It builds a scratch bare repo in a temp dir and sets its own Git identity withGIT_CONFIG_GLOBAL=/dev/null. It then setsorigintobuildbox:<scratch>/srv//git/repo.gitand tobuildbox:<scratch>/srv/git/repo.git//, and runsGIT_SSH_VARIANT=ssh GIT_SSH=<stub> git ls-remote originfor each. The stub runs only its last argument throughsh -c. Finally it probes the configured origins withnode -efromapps/server, so nothing is written into the checkout.git-upload-packwith each path unchanged and lists refs. For both origins,userlessScpRemoteHostreturnsnull,isSshRemoteUrlreturnsfalseandparseGitRemoteHostreturnsnull. The controlsbuildbox:/srv/git/repo.gitandgit@buildbox:/srv//git/repo.gitresolve tobuildbox.buildbox,trueandbuildboxfor both origins.Change
The userless SCP pattern now allows a run of slashes between nonempty path segments (
\/→\/+) and a run of trailing slashes (\/?$→\/*$). The host rule, the single-letter Windows drive guard, the::remote-helper guard and the optional leading slash are unchanged.isSshRemoteUrlandparseGitRemoteHostboth call this function, so source-control provider recognition and server repository identity detection are fixed together.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/shared/src/sourceControl.test.ts: added the interior and trailing repeated-slash remotes to the positiveisSshRemoteUrlcases and to a newuserlessScpRemoteHostcase. With base source, the 4 new cases fail (expected false to be true,expected null to be 'buildbox'). On head, all 22 tests pass, including the existing negative controls (hg::owner/repo,C:repo.git,C:/repos/repo,/srv/git/repo.git,file:///…,https://…).parseGitRemoteHostconsumer tests pass:source-control-githubdefinition.test.ts(14) andsource-control-gitlabgitLabDiscovery.test.ts(9).commit-checked.shranvp run check:changedon the tree committed as894a44f29f3and exited 0 (format, lint, knip, typecheck for 38 packages, affected tests). The gist includes its summary.git ls-remoteruns, probe output on the same configured origins, and the repro script: https://gist.github.com/saphid/b2c5d49222b694d5b5a409d29b39084bNot shown: a connection to a real SSH host (the local stub stands in for
ssh), and an end-to-end run ofRepositoryIdentityResolver's alias lookup in the running app.Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).