Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(cursor): fall back to session models on older cli versions #9922

Closedmaria-rckswants to merge 2 commits intomain fromrefs/pull/9922/headopened View on GitHub

maria-rckscommented

supported cursor versions without cursor/list_available_models lost their discovered model catalog. use the existing ACP session catalog only when that extension is missing, preserving errors from supported extensions. the existing minimum version and lab-channel requirements remain: the 2026.03.20 CLI reported in #8022 still requires an update, so this is a partial compatibility improvement.

verified with 31 focused cursor tests, a two-test final rerun, server typecheck, and scoped lint and formatting checks.

cursor compatibility: 31 tests passed

relates to #8022.

implemented with gpt-6-astra in codex.


Note

Medium Risk Changes provider model discovery semantics for older Cursor CLIs; behavior is gated on a specific error code and session catalog presence, with focused tests, but callers that previously saw discovery fail may now get session-derived models.

Overview Restores Cursor model discovery on older CLIs that do not implement cursor/list_available_models. Discovery still uses that extension when present; if the call fails with method not found (-32601) and the ACP session already advertises models, the provider builds the catalog from that session model state instead of failing.

Fallback entries are trimmed, invalid slug/name pairs are dropped, capabilities are empty, and the model matching the session’s current ID is marked default. Other ACP errors (including internal failures from a CLI that does support the extension) still surface to callers.

The mock ACP agent adds T3_ACP_CURSOR_MODELS_ERROR toggles for the missing-extension and internal-error paths, with matching tests in CursorProvider.test.ts.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d5f79e7aee84354c524612e4ded8361b91c18395. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fall back to ACP session catalog when cursor/list_available_models is unavailable

  • discoverCursorModelsViaListAvailableModels now retains the ACP session setup result and, on a method-not-found error from cursor/list_available_models, falls back to the session model catalog when it contains entries.
  • Fallback models are trimmed of whitespace, entries with blank identifiers or names are discarded, capabilities are left empty, and the trimmed current session model is marked as default.
  • Other ACP request errors (including internal failures from a supported extension) are still propagated to the caller rather than triggering fallback.
  • The mock agent and CursorProvider.test.ts add fixtures and tests for both the missing-extension fallback and the internal-error propagation paths.
  • Risk: fallback only triggers on method-not-found with a non-empty session catalog; callers that relied on a hard failure in this scenario will now receive filtered session models instead.
Macroscope summarized d5f79e7.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at d5f79e7

      Macroscope's review found this PR approvable — This is a focused Cursor compatibility fix: the existing model-discovery extension remains preferred, while only older CLIs lacking that method use their already-advertised session catalog, with invalid entries filtered and other failures preserved. The remaining changes are mock-agent and regression-test coverage, with no product-default or static-analysis override changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

      Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

    4. juliusmarminge closed this

Sign in to join this conversation.