GeezerVison is showing github.com — fix(source-control): accept Cursor Origin URLs in repo lookup and surface clear errors by bedair81 · Pull Request #44400 · pingdotgg/t3code
Conversation
Problem
Looking up a Cursor Origin repository to clone (sourceControl.lookupRepository → OriginSourceControlProvider.getRepositoryCloneUrls) fails with a generic error ("The source control operation could not be completed.") whenever the input is anything other than bare owner/name:
OriginSourceControlProvider.getRepositoryCloneUrls passed input.repository raw into OriginCli.originRepositoryPath, so pasting an Origin clone or browser URL sent malformed requests to api.cursor.com:
https://origin.cursor.com/owner/repo.git → 404 GET /v1/origin/repos/https%3A//origin.cursor.com/owner/repo.git
[email protected]:owner/repo.git → 400 GET /v1/origin/repos/git%40origin.cursor.com%3Aowner/repo.git
https://cursor.com/codebase/owner/repo/tree/main → 404 GET /v1/origin/repos/https%3A//cursor.com/codebase/owner/repo/tree/main
OriginCliError never set userFacingDetail, so SourceControlRepositoryService.mapRepositoryError discarded the reason on both malformed inputs and 404 responses, unlike the sibling GitHub, GitLab, Bitbucket, Forgejo, and GitCafe providers.
Change
OriginCli.ts:
- Adds optional
userFacingDetail to OriginCliError (matching ForgejoCliError, GitCafeApiError, and BitbucketResponseError).
- Adds
parseOriginRepository, normalizing owner/name[.git], origin.cursor.com HTTPS/SSH/SCP remote URLs, and cursor.com/codebase/owner/name (including /tree/... and /blob/...) web URLs into owner/name, and rejecting foreign hosts or malformed paths.
OriginSourceControlProvider.ts:
- Validates and normalizes
input.repository in getRepositoryCloneUrls before calling the API, returning a clear userFacingDetail ("Specify an Origin repository as owner/name or a Cursor Origin URL.") on invalid input.
- Attaches
SourceControlProvider.repositoryNotFoundDetail(repositoryName) as userFacingDetail on 404 (not-found) responses while keeping non-404 upstream errors private.
- Passes the normalized
repositoryName as the fallback name to cloneUrls.
originRepositoryLookup.test.ts:
- Focused unit tests covering valid normalization, invalid/foreign input rejection without API calls, and
404 vs 500 userFacingDetail handling.
Scope
Small bug fix scoped strictly to packages/source-control-cursor-origin (3 files, no dependency or lockfile changes). Needs no separate issue per CONTRIBUTING.md: every sibling source-control provider already parses pasted URLs and surfaces userFacingDetail on lookup failures.
Verification
Failing test on main before the fix
Running vp test run packages/source-control-cursor-origin/src/server/originRepositoryLookup.test.ts against origin/main (38452ae605) failed all 3 cases:
- URL/whitespace inputs were not normalized (
nameWithOwner: " bedair81/mic-mute-tray.git ", url: "https://origin.cursor.com/ bedair81/mic-mute-tray.git .git").
- Malformed/foreign inputs still invoked
OriginCli.api.
404 responses left userFacingSourceControlDetail(error.cause) as undefined.
Live runtime transcript against Cursor Origin API
Verified OriginSourceControlProvider.make wired to the real OriginCli.layer and signed-in origin CLI against api.cursor.com:
OK https://origin.cursor.com/bedair81/mic-mute-tray.git -> bedair81/mic-mute-tray https://origin.cursor.com/bedair81/mic-mute-tray.git
OK [email protected]:bedair81/mic-mute-tray.git -> bedair81/mic-mute-tray https://origin.cursor.com/bedair81/mic-mute-tray.git
OK https://cursor.com/codebase/bedair81/mic-mute-tray/tree/main -> bedair81/mic-mute-tray https://origin.cursor.com/bedair81/mic-mute-tray.git
FAIL bedair81/mic-mute-tray/tree/main -> userFacingDetail: "Specify an Origin repository as owner/name or a Cursor Origin URL."
FAIL https://origin.cursor.com/bedair81/does-not-exist-t3code-check.git -> userFacingDetail: "Repository bedair81/does-not-exist-t3code-check was not found. Check the owner and name and try again."
Checks
vp test run packages/source-control-cursor-origin/src/server/originRepositoryLookup.test.ts packages/source-control-cursor-origin/src/server/originPullRequests.test.ts: 2 files, 6 tests passed.
vp run check:changed: passed (format, lint, knip 1/2, knip 2/2, typecheck across 11 packages, test).
Not checked: interactive desktop UI clone modal (the lookup RPC already propagates userFacingSourceControlDetail(cause.cause) via SourceControlRepositoryService.mapRepositoryError).
Gemini 4 Neon (Antigravity harness)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…face clear errors
Normalize owner/name, origin.cursor.com HTTPS/SSH remotes, and cursor.com/codebase URLs before calling the Cursor Origin API in getRepositoryCloneUrls, and populate userFacingDetail on invalid input and 404 responses.
coderabbitai
Bot
commented
Nov 27, 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
-
The change adds parsing and normalization for repository names and supported Cursor Origin URLs. The provider uses normalized names for repository lookups and clone URL fallback. It returns user-facing details for invalid inputs, missing repositories, and access-denied errors.
Changes: Origin repository lookup
| Layer / File(s) |
Summary |
Repository input parsing packages/source-control-cursor-origin/src/server/OriginCli.ts |
The parser accepts owner/name, supported Cursor Origin git remotes, and Cursor codebase URLs. It normalizes valid paths and returns null for invalid inputs. OriginCliError gains an optional user-facing detail field. |
Provider lookup and error details packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.ts, packages/source-control-cursor-origin/src/server/originRepositoryLookup.test.ts |
The provider looks up the normalized repository name and uses it as the clone URL fallback. Invalid inputs, not-found results, and HTTP 403 errors receive user-facing details. Tests cover accepted forms, rejected inputs, and lookup errors. |
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Caller
participant OriginSourceControlProvider
participant parseOriginRepository
participant OriginAPI
Caller->>OriginSourceControlProvider: getRepositoryCloneUrls(repository)
OriginSourceControlProvider->>parseOriginRepository: Parse and normalize repository
parseOriginRepository-->>OriginSourceControlProvider: owner/name or null
OriginSourceControlProvider->>OriginAPI: Look up normalized owner/name
OriginAPI-->>OriginSourceControlProvider: Lookup result
OriginSourceControlProvider-->>Caller: Clone URLs or user-facing error
Loading
Suggested reviewers: juliusmarminge, macroscopeapp
Merge Risk: Low · up to 7f3ee
-
Repository lookup now accepts URLs as well as owner/name. Two edge cases remain open: percent-encoded URL segments and double .git suffixes can resolve to the wrong repository path. These are unlikely inputs, so the merge risk is low.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title names the main change: Cursor Origin URLs are now accepted in repository lookup, and lookup errors are surfaced clearly. It matches the parsing and user-facing error changes in the summary a… |
| Description check |
 |
The description follows the template: it has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section gives reproduction inputs and the faili… |
| 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: Cursor Origin URLs are now accepted in repository lookup, and lookup errors are surfaced clearly. It matches the parsing and user-facing error changes in the summary and objectives. It uses the conventional commit form and is specific enough for a teammate scanning history.
Full details: Description check
-
Explanation
The description follows the template: it has Problem, Change, Scope, and Verification sections, and each is filled in with specific content. The Problem section gives reproduction inputs and the failing responses. The Change section lists the three modified files. The Scope section names the package and explains why no separate issue is needed. The Verification section gives a failing-before-fix run, a live transcript, and check results, and it states what was not checked. The description does not name an issue link, and the template asks for one for bug fixes unless the author justifies its absence. The author gives that justification, so the section is complete. The closing agent-model line is present.
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 2107740 and 7f3eee4.
Files selected for processing: 2
-
packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.ts
packages/source-control-cursor-origin/src/server/originRepositoryLookup.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
|