fix(cursor): explain model rejections from the account catalog #19678
main fromrefs/pull/19678/head·merged by juliusmarminge View on GitHubProblem#
Selecting a custom Cursor model outside the account catalog fails with a generic SDK error. Existing-thread failures suggest retrying even though the selected model cannot run.
Change#
Classify the SDK's specific local model rejection at the Cursor adapter boundary. New-thread opens and sends on existing threads now explain the account-model requirement and point API-key models to OpenCode. Other SDK failures retain their existing handling.
Scope and approval#
Refs #13267. The report's ACP path has been replaced by Cursor SDK on main, but the opaque rejection remains. This is a focused diagnostic fix for that existing failure. It does not change the model picker, custom-model settings, provider policies or retry behavior.
Verification#
Primary and a fresh independent full review each passed all 27 focused Cursor adapter, driver and provider-failure cases. The author also reproduced the rejection with the real SDK offline using a synthetic key and its catalog override. Public adapter tests cover opening with an off-catalog model and selecting one on an existing agent. Scoped typechecks and targeted lint passed.
No live Cursor account or client browser/device was tested. Classification depends on the SDK's uncoded error type and message prefix. Server-side rejections after a successful local check and Cursor text-generation diagnostics remain unchanged. Existing turn-start retries still apply.
Prepared for Wout byclaude-opus-5-5 in T3 Code's Claude harness. Validated by gpt-6.1-sol in Codex.- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
fe223b5Macroscope's review found this PR approvable — This is a contained diagnostic bug fix that changes only how a specific Cursor account-catalog rejection is presented, while preserving successful requests and unrelated failures. Tests cover both new-thread creation and model switches on existing threads, with no defaults, schema, deployment, or sensitive-package changes.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
a1fcc15e-fc17-4778-9101-506bb6c49453
📥 Commits
-
Reviewing files that changed from the base of the PR and between 742c229957b69a0cc5a1379dff6c66b595854057 and fe223b5484c7a3cc3b7ee1b0ae2ec10b72f16f9b.
📒 Files selected for processing: 4
-
packages/provider-core/src/server/failure.tspackages/provider-cursor/src/server/adapter.test.tspackages/provider-cursor/src/server/adapter.tspackages/provider-cursor/src/server/sdk.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
-
📝 Walkthrough
-
The Cursor adapter now maps model-rejection configuration errors from thread creation and turn startup to a dedicated error. Provider failure formatting returns that error’s message. Tests cover both paths.
Changes: Cursor model error handling
Layer / File(s) Summary Map model rejections to provider failures
packages/provider-cursor/src/server/adapter.ts,packages/provider-cursor/src/server/sdk.ts,packages/provider-core/src/server/failure.ts,packages/provider-cursor/src/server/adapter.test.tsThe adapter maps matching Cursor configuration errors from thread creation and turn startup to CursorModelUnavailableError. Provider failure formatting returns its message. Tests verify the resulting failure for both paths.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
fe223-
No actionable issue remains in the supplied evidence; the change is mergeable after normal checks.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: explaining Cursor model rejections from the account catalog. Description check The description covers the problem, change, scope, issue reference, verification results, limitations, and agent details. It explains why the focused fix does not require broader behavior changes. 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.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged this71aa117
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes