Repository navigation
Conversation
Keep expired-sign-in reporting for HTTP 401 and redirects to Cursor's login page. Preserve the HTTP status for forbidden responses and other redirects instead of asking users to sign in again. Cover both usage endpoints and relative, foreign, or malformed redirect locations with regression tests. Refs stablyai#23612
Remove the login redirect predicate: Electron net.fetch rejects manual redirects before a Response reaches the classifier. Keep the existing local token-expiry check and preserve HTTP errors through the existing fallback instead of guessing a login URL. Cover forbidden responses on both endpoints, HTTP 304, redirect cancellation, and preservation of manual redirect mode. Refs stablyai#23612
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue remains in the supplied change; merge after normal CI validation. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed both commits on the branch — the Cursor usage error-classification fix in cursor-fetcher.ts and its regression tests.
- Expiry classification narrowed to HTTP 401 — the base predicate (
401 || 403 || 3xx→stale-token) is now401only; 403, 304 and other non-OK responses fall through to the existing!res.okbucket withfailureKind: 'server'and the HTTP status retained, whileauthProvenanceis still published so the account-switch guard keeps working. The local token-expiry precheck is unchanged. - Login-redirect predicate removed — commit 1's
isCursorLoginRedirect()helper (and the3xxbranch it replaced) is gone. Verified against Electron 43.7.0 source thatnet.fetchresolvesredirect: 'manual'throughfetchWithSession, which passes the mode toClientRequestwith noredirecthandler, so an unfollowed redirect rejects before anyResponsereaches the classifier. The removed branches were dead code; real redirects already surfaced asfailureKind: 'network', so this is not a UX regression. - Redirect comment rewritten —
redirect: 'manual'stays, now documented as a security choice (do not follow dashboard redirects with session credentials). - Tests updated — 403/304 and the legacy-endpoint 403 now assert the HTTP status text and
serverkind; the removed302 → stale-tokencase is replaced by a rejection case forRedirect was cancelled. The 403/304 assertions fail against the base predicate, so they are real regression coverage.cursor-fetcher.test.ts: 18 passed locally.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Superseded by merged #24575. Thank you @Li-Sanze for the Cursor HTTP-status classification fix; credit is preserved in the successor. Both usage endpoints distinguish request failures from expired credentials. The original failing authenticated request remains tracked in #23612; this closure retires the duplicate implementation, not that unresolved report. |
Keep Cursor quota requests tied to the selected account by omitting ambient Electron session credentials. Preserve explicit account cookies and redirect handling. Credit: Li-Sanze for the original credential-mode fix in #23626, carried through #24575; jjongsta and chengjiaxiao for the reports. Native HTTP/HTTPS cookie isolation, mutation controls and proxy behavior were verified before merging. This does not claim to resolve the separate initial-authentication failure in #23612.

ELI5
When Cursor refuses a usage request with HTTP 403, Orca should show the request failure instead of telling a signed-in user to log in again.
What Changed
Only HTTP 401 and the existing local token-expiry check report expired sign-in. Other non-OK responses reuse the existing HTTP-status error. Both usage endpoints share this behavior; redirect cancellation remains a generic network failure.
Why
403 does not establish expired credentials. This changes one condition, corrects its nearby comment, and adds regression coverage; no new login-path assumptions or transport changes.
Linked Issue
Refs #23612 (error classification only). The original failing response was not captured; this does not establish its root cause or fix network connectivity. The separate Codex proxy work remains tracked in #19931 and #11862.
Visual Proof
N/A — main-process classification only; no layout or interaction code changed. Existing error rendering is reused:
Testing
macOS arm64: 59 Cursor tests pass; full lint and typecheck pass.
pnpm test --maxWorkers=2was stopped (exit 130) after cross-version fixture failures; a focused rerun confirmed the required release tagv1.4.190is absent locally. This is not a passing full-suite run. GitHub PR Checks currently require maintainer approval before they can run.Build: desktop, CLI and web bundles pass;
pnpm buildstops at the mobile web bundle because this checkout lacks mobile dependencies (react-native-web,expo-router). Full application UI, Windows/Linux and SSH runtime checks were not performed.A windowless Electron 43.7.0 loopback fixture confirmed 401/403/304 return responses; 302/307 reject with
Redirect was cancelledand do not follow the target. No account credentials were used.AI Disclosure
Implemented/reviewed with Codex (GPT-6); independently cross-reviewed with Cursor Agent (Grok 4.7).
Review
Cursor's final review found no blockers. Pullfrog and CodeRabbit reviewed
cc2164e5with no actionable code findings; CodeRabbit's generic docstring-coverage warning does not warrant expanding this fix. Cross-platform/SSH/local: shared main-process logic, no paths or host assumptions added. Agents/integrations: Cursor-only; no wire-format changes. Performance/security: no added requests, logging or credential handling; redirects remain manual. UI: existing error display reused.Agent skill upstream boundary
Author
GitHub: @Li-Sanze · X: @evidentloop
Notes
No release, proxy, authentication-storage or mobile protocol changes.
Checklist