GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cursor): refresh cached workspace model list after a Cursor model rejection by Mr-Neutr0n · Pull Request #39248 · pingdotgg/t3code

Conversation

@Mr-Neutr0n

@Mr-Neutr0n Mr-Neutr0n commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Problem

When Cursor adds a model (such as gemini-4-neon) while a T3 Code server is already running, projects that previously ran a Cursor thread reject the new model on Agent.create, Agent.resume, and agent.send until the server restarts. Fresh scratch folders succeed immediately.

@cursor/sdk caches one CursorAgentPlatform per workspace folder in a module-level map, and each platform caches GET /v1/models in localModelListCache with no expiry or invalidation on model rejection (still present in @cursor/[email protected]). Once that cached list is stale, resolveLocalModelSelection throws ConfigurationError: Cannot use this model: ... for any newly added model.

Fixes #39240.

Change

In packages/provider-cursor/src/server/CursorAgentSdk.ts:

  • Detect SDK model rejections (ConfigurationError whose message starts with "Cannot use this model:") in both CursorAgentSdkRunner.open and CursorAgentSdkSession.send.
  • Clear localModelListCache on the workspace's CursorAgentPlatform (including the storePlatform path for moved-workspace resumes and agent.platform on send) and retry the call once.
  • If the model is still rejected after that single refresh, propagate the original ConfigurationError without looping. Skip the open retry when a custom local.store was passed, since @cursor/sdk creates an uncached platform for that call.

Scope

Fixes #39240. Changes are confined to CursorAgentSdk.ts and CursorAgentSdk.test.ts for this single bug.

Verification

  1. Reproduced the failure live on T3 Code Desktop 0.1.10 (@cursor/sdk 1.3.1): launching gemini-4-neon (reasoning_effort: high) in an existing project failed with Cannot use this model: gemini-4-neon (listing gemini-4-carbon, gemini-4-hydrogen, gemini-4-argon), while launching the same model and options in a new scratch folder succeeded at the same minute.
  2. Added two focused tests in packages/provider-cursor/src/server/CursorAgentSdk.test.ts before applying the fix:
    • Real @cursor/sdk test backed by a loopback /v1/models server covering create, resume, moved-workspace resume (storeCwd), and a genuinely unavailable model (confirming one refresh and no retry loop).
    • Unit test for session.send clearing agent.platform.localModelListCache once when switching to a newly added model mid-thread, and stopping after one retry for a missing model.
    • Both tests failed on main with ConfigurationError: Cannot use this model: gemini-4-neon.
  3. After the fix, ran:
    • vp test run packages/provider-cursor/src/server/CursorAgentSdk.test.ts packages/provider-cursor/src/server/adapter.test.ts: 2 files, 38 passed.
    • vp run check:changed: passed (unused patches, format, lint, knip, typecheck across 42 packages, 10 passed in changed test files).
  4. Did not run repo-wide test suites or desktop packaging builds; leaving those to CI.

Gemini 4 Neon in T3 Code (Cursor harness).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Mr-Neutr0n
fix(cursor): refresh cached workspace model list after a Cursor model…
408d965
… rejection
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 19, 2026
@juliusmarminge

juliusmarminge commented Nov 19, 2026

Copy link
Copy Markdown
Member

Thanks for this. #39246 makes the same change and is the one being kept.

#39246 fixes the same stale workspace model list inside the SDK’s shared model validation. That keeps the refresh at the cache lookup and avoids retrying whole agent operations, so it is the smaller fix to carry forward.

Your coverage of resumed threads, moved workspaces, and switching models mid-thread is useful regression coverage to retain when reviewing the kept fix.

Closing as a duplicate.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cursor rejects newly added models in projects that already ran a Cursor thread until T3 restarts

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Mr-Neutr0n @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.