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
{{ message }}
Repository navigation
fix(source-control): Cursor Origin auth status names its --json fields - #35636
Origin CLI 2026.11.03 exits 1 on a bare origin auth status --json and only accepts --json with a comma-separated field list. T3 Code ran the bare form in two places. Discovery in OriginSourceControlProvider.ts therefore reported auth as 'unknown' (the 'Could not verify Cursor Origin' row), and OriginCli.authStatus, which viewer calls, failed with the CLI error, so Origin pull requests could not load. The fix adds one constant, ORIGIN_AUTH_STATUS_ARGS = auth status --json authenticated,tokenValid,account, in OriginCli.ts and uses it in both places. Those are exactly the fields OriginAuthStatusSchema reads, so parsing is unchanged. No new regex or parser. The repro branch's test was kept: it fails on the base and passes with the fix. The fix was checked against the test's fake CLI, not the real Origin CLI, and was not checked against CLI versions older than 2026.11.03.
Commit 5f43681 (origin/main). Downloaded the Origin CLI stable build 2026.11.03-22-10-56-fbcd8ba for linux-x64 (the reporter's version) into a scratch dir; it was signed in through CURSOR_API_KEY. origin auth status --json printed 'Error: Specify one or more comma-separated fields for --json: authenticated, authMethod, ...' and exited 1. origin auth status --json authenticated,tokenValid,account exited 0 with {"authenticated":true,...}. Started T3CODE_DEV_SEED=0 vp run dev with that CLI first on PATH, paired a browser and opened /settings/source-control: the Cursor Origin row showed '2026.11.03-22-10-56-fbcd8ba' and 'Could not verify Cursor Origin. Install the Origin CLI with curl -fsSL https://downloads.cursor.com/origin/install.sh | sh, then run origin auth login.' Added packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.test.ts, which fakes the CLI's behaviour (exit 1 on a bare --json); it fails on main with auth status 'unknown' instead of 'authenticated', and passes when the field names are added to authArgs.
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run src in packages/source-control-cursor-origin: 2 files, 4 tests, all passed. Same test file with the fix stashed: failed with expected 'unknown' to equal 'authenticated'. vp run check:changed: passed (unused patches, format, lint, knip, typecheck of 41 packages, tests for 2 files).
Not in this change
packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.ts also runs auth status --json with no fields; that is the cafe CLI, not Origin, and is not part of this bug.
AI-assisted; verified with the tests and tools listed above.
…s --json fields
Origin CLI 2026.11.03 exits 1 on a bare `origin auth status --json`, so a
signed-in CLI is reported as auth "unknown". Fails on main (#35624).
AI-assisted; verified with the tests and tools listed above.
Origin CLI 2026.11.03 exits 1 on a bare `origin auth status --json`, so
discovery reported Cursor Origin as unverifiable and the pull request
viewer lookup failed. Both now ask for authenticated,tokenValid,account.
AI-assisted; verified with the tests and tools listed above.
Macroscope's review found this PR approvable — This repairs Cursor Origin session detection by naming the requested JSON fields and accepting nullable token-check results. Existing authentication checks and API authorization remain in place, with no material change to permissions or product defaults.
No code changes detected at bbd099e. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between dcc8238 and bbd099e.
Files ignored due to path filters: 1
pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
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 Origin CLI auth-status request now names the JSON fields it needs. Provider discovery uses the shared argument list, and a test verifies that it recognizes an authenticated CLI that rejects bare JSON requests.
Changes: Origin authentication discovery
Layer / File(s)
Summary
Named auth-status fields and discovery test packages/source-control-cursor-origin/src/server/OriginCli.ts, packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.ts, packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.test.ts, packages/source-control-cursor-origin/package.json
OriginCli defines and uses ORIGIN_AUTH_STATUS_ARGS with the authenticated,tokenValid,account fields. The auth-status schema accepts null for tokenValid. Provider discovery uses the shared arguments. The test covers a mock CLI that rejects bare --json and returns authenticated status when given field names. The package adds the testing workspace dependency.
The change makes Origin CLI authentication discovery work with CLI versions that require field names after --json. No actionable merge-blocking risk remains. The fix was tested against a fake CLI rather than the real Origin CLI.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the Cursor Origin auth status fix and the --json field names, which matches the main change: ORIGIN_AUTH_STATUS_ARGS now passes explicit fields to origin auth status --json in both d…
Description check
The description follows the template's main sections. Problem and Change are clear and specific: the Origin CLI 2026.11.03 exits 1 on bare --json, and the fix adds ORIGIN_AUTH_STATUS_ARGS. Scope lin…
Linked Issues check
[#35624] Requirement: a signed-in Cursor Origin CLI shows as authenticated, and Origin pull requests load. Root cause: bare origin auth status --json exits 1 on Origin CLI 2026.11.03, so discovery r…
Out of Scope Changes check
Changed hunks: (1) OriginCli.ts adds ORIGIN_AUTH_STATUS_ARGS and uses it in authStatus. (2) OriginCli.ts widens OriginAuthStatusSchema.tokenValid to Schema.NullOr(Schema.Boolean). (3) OriginSourceCont…
Full details: Title check
Explanation
The title names the Cursor Origin auth status fix and the --json field names, which matches the main change: ORIGIN_AUTH_STATUS_ARGS now passes explicit fields to origin auth status --json in both discovery and authStatus. It uses a conventional commit prefix and is specific enough for a teammate scanning history. It is 70 characters, slightly above the usual length, but this is acceptable.
Full details: Description check
Explanation
The description follows the template's main sections. Problem and Change are clear and specific: the Origin CLI 2026.11.03 exits 1 on bare --json, and the fix adds ORIGIN_AUTH_STATUS_ARGS. Scope links issue #35624 as the bug report. Verification gives concrete test and manual results, and it states what was not checked. Two gaps remain. The Evidence section says it is still being captured and that it must be filled before merge. The closing line names the tools used but not the model and harness, which the template asks for when an agent was used. The description also has no separate heading for the Problem and Change sections; the content sits under a single opening paragraph. These gaps are non-critical to the overall check.
Full details: Linked Issues check
Explanation
[#35624] Requirement: a signed-in Cursor Origin CLI shows as authenticated, and Origin pull requests load. Root cause: bare origin auth status --json exits 1 on Origin CLI 2026.11.03, so discovery reports auth as 'unknown' and OriginCli.authStatus fails. The change adds ORIGIN_AUTH_STATUS_ARGS (auth status --json authenticated,tokenValid,account) in OriginCli.ts and uses it in OriginSourceControlProvider.ts discovery. The field names match those read by OriginAuthStatusSchema. The regression test in OriginSourceControlProvider.test.ts uses a fake CLI that exits 1 on bare --json and asserts 'authenticated'. Per the PR, this test fails on the base and passes with the fix. The change also makes OriginAuthStatusSchema.tokenValid accept null. The commit message attributes a null tokenValid to API-key sign-in, which the reporter's environment uses. This supports the signed-in requirement. Limits: the fix was validated only against a fake CLI, not the real Origin CLI. The null-tokenValid path is not shown to have a dedicated test in the summary. The viewer path relies on the PR statement that viewer calls OriginCli.authStatus, and the viewer code is not shown directly.
Full details: Out of Scope Changes check
Explanation
Changed hunks: (1) OriginCli.ts adds ORIGIN_AUTH_STATUS_ARGS and uses it in authStatus. (2) OriginCli.ts widens OriginAuthStatusSchema.tokenValid to Schema.NullOr(Schema.Boolean). (3) OriginSourceControlProvider.ts replaces the literal args with the constant. (4) OriginSourceControlProvider.test.ts adds the regression test. (5) packages/source-control-cursor-origin/package.json adds @t3tools/source-control-testing as a dev dependency for the test. Hunks 1, 3, and 4 implement #35624 directly. Hunk 5 supports hunk 4. Hunk 2 connects to #35624 through the null tokenValid case in the commit message, which affects the signed-in path. No GitCafe change appears in the summary. Note: the current PR description says parsing is unchanged, but it does not mention the schema change in hunk 2. This is a description gap, not an unrelated change. The lockfile is excluded by ignored_files and is not assessed.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
…status
The Origin CLI reports "tokenValid": null for an API-key sign-in, which the
auth status schema rejected, so a signed-in CLI still read as unverifiable.
AI-assisted; verified with the tests and tools listed above.
This duplicates #33507, which has been open since Nov 9 with the same fix: the same ORIGIN_AUTH_STATUS_ARGS constant, field list and call sites, the same fake-CLI test, and Fixes #35624. I have also added this PR's tokenValid: null handling for API-key sign-ins to #33507, with a test case that fails without it, so #33507 now covers both.
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:S10-29 changed lines (additions + deletions).vouch:trustedPR author 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.
Origin CLI 2026.11.03 exits 1 on a bare
origin auth status --jsonand only accepts--jsonwith a comma-separated field list. T3 Code ran the bare form in two places. Discovery in OriginSourceControlProvider.ts therefore reported auth as 'unknown' (the 'Could not verify Cursor Origin' row), and OriginCli.authStatus, which viewer calls, failed with the CLI error, so Origin pull requests could not load. The fix adds one constant, ORIGIN_AUTH_STATUS_ARGS = auth status --json authenticated,tokenValid,account, in OriginCli.ts and uses it in both places. Those are exactly the fields OriginAuthStatusSchema reads, so parsing is unchanged. No new regex or parser. The repro branch's test was kept: it fails on the base and passes with the fix. The fix was checked against the test's fake CLI, not the real Origin CLI, and was not checked against CLI versions older than 2026.11.03.Fixes #35624
Reproduction on main
Commit 5f43681 (origin/main). Downloaded the Origin CLI stable build 2026.11.03-22-10-56-fbcd8ba for linux-x64 (the reporter's version) into a scratch dir; it was signed in through CURSOR_API_KEY.
origin auth status --jsonprinted 'Error: Specify one or more comma-separated fields for--json: authenticated, authMethod, ...' and exited 1.origin auth status --json authenticated,tokenValid,accountexited 0 with {"authenticated":true,...}. StartedT3CODE_DEV_SEED=0 vp run devwith that CLI first on PATH, paired a browser and opened /settings/source-control: the Cursor Origin row showed '2026.11.03-22-10-56-fbcd8ba' and 'Could not verify Cursor Origin. Install the Origin CLI withcurl -fsSL https://downloads.cursor.com/origin/install.sh | sh, then runorigin auth login.' Added packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.test.ts, which fakes the CLI's behaviour (exit 1 on a bare --json); it fails on main with auth status 'unknown' instead of 'authenticated', and passes when the field names are added to authArgs.Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run srcin packages/source-control-cursor-origin: 2 files, 4 tests, all passed. Same test file with the fix stashed: failed with expected 'unknown' to equal 'authenticated'.vp run check:changed: passed (unused patches, format, lint, knip, typecheck of 41 packages, tests for 2 files).Not in this change
auth status --jsonwith no fields; that is the cafe CLI, not Origin, and is not part of this bug.AI-assisted; verified with the tests and tools listed above.