Skip to content

fix(source-control): Cursor Origin auth status names its --json fields - #35636

Open
juliusmarminge wants to merge 4 commits into
mainfrom
factory/issue-35624
Open

juliusmarminge wants to merge 4 commits into
mainfrom
factory/issue-35624

Conversation

@juliusmarminge

Copy link
Copy Markdown
Member

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.

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 --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.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 12, 2026
@bedair81

Copy link
Copy Markdown

if this merges can close #33507 as a duplicate

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at dcc8238

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.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 42.9 KiB 42.9 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 42.9 KiB 42.9 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: e253b88 · PR result: bbd099e · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Run configuration

Commits

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.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: maria-rcks

Merge Risk: Minimal · previous review dcc82

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: Passed 4

Check name Status Explanation
Title check Passed 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 Passed 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 Passed [#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 Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c13a10d and dcc8238.

Files selected for processing: 2

  • packages/source-control-cursor-origin/src/server/OriginCli.ts
  • packages/source-control-cursor-origin/src/server/OriginSourceControlProvider.test.ts

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

…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.
@macroscopeapp
macroscopeapp Bot dismissed their stale review November 12, 2026 22:36

Dismissing prior approval to re-evaluate dcc8238

@bedair81

Copy link
Copy Markdown

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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cursor Origin shows "Could not verify" for a signed-in CLI because origin auth status --json needs field names

2 participants