Skip to content

fix(server): probe Cursor thinking options per model - #4180

Open
fidelix wants to merge 2 commits into
getpaseo:mainfrom
fidelix:fix/cursor-per-model-thinking
Open

fix(server): probe Cursor thinking options per model#4180
fidelix wants to merge 2 commits into
getpaseo:mainfrom
fidelix:fix/cursor-per-model-thinking

Conversation

@fidelix

@fidelix fidelix commented Sep 1, 2026

Copy link
Copy Markdown

Linked issue

Closes #4177

Type of change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Docs

Reasoning

Cursor ACP only reports thinking levels for the model that is currently selected. The catalog probe then copied that one list onto every Cursor model.

If the probe session defaulted to Haiku, Grok 4.6 inherited Off/On. If it defaulted to Grok, every model inherited Low/Medium/High/Extra High. A daemon restart sometimes flipped which list you got. The composer was showing the cached catalog faithfully; it was not inventing Off/On.

Kimi already opted into a per-model catalog probe. Cursor now uses the same helper: during fetchCatalog, switch each model with session/set_config_option and read that model's thought_level.

If a switch fails, the catalog no longer keeps another model's thinking list. Non-current models omit thinking options. The current model keeps the options from session/new.

Goals

  • Grok 4.6 in the Cursor catalog gets Grok thinking levels, even when the probe session defaulted to a boolean-thinking model.
  • Haiku and other Off/On models keep Off/On.
  • Generic ACP providers still do not switch models during catalog discovery.
  • A failed per-model probe does not fail the whole catalog. It omits thinking options for that model unless it is the probe session's current model.

Non-goals

  • Updating thinking options on a live session after the user switches models. The composer still reads the catalog snapshot.
  • Changing Cursor Fast mode.
  • Putting per-model probing on every ACP provider.

QA

Before (failing test, no catalog resolver on Cursor):

FAIL  cursor-acp-agent.test.ts > probes each model so Haiku Off/On is not stamped onto Grok 4.6
AssertionError: expected "vi.fn()" to be called 2 times, but got 0 times

That is the bug: fetchCatalog never switched models, so every model kept Haiku's Off/On.

After:

npx vitest run src/server/agent/providers/cursor-acp-agent.test.ts src/server/agent/providers/kimi-acp-agent.test.ts --bail=1
Test Files  2 passed (2)
     Tests  12 passed (12)

Also ran acp-agent.test.ts never switches models during catalog discovery — still green.

Failed-probe coverage: a rejected switch on Grok omits thinking options instead of keeping Haiku's Off/On. If the current model's switch fails, that model's session/new options stay.

Live cursor-agent ACP (2026.08.25-3e8eec8), same host as #4177:

session/new defaulted to claude-haiku-4-5:

  • thought_level id thinking, values Off/On (false/true)

session/set_config_option to grok-4.6:

  • thought_level id effort, values Low / Medium / High / Extra High (low/medium/high/xhigh), current xhigh

That matches the screenshot: Grok 4.6 showing Off/On because the catalog was probed while Haiku was current.

To pick up the fix on an existing daemon, refresh providers (Settings) or restart the daemon. Opening the thinking menu does not re-probe.

Platform Tested Notes
iOS No UI change
Android No UI change
Web No UI change
Desktop macOS Not tested
Desktop Windows Not tested
Desktop Linux x Unit tests + live cursor-agent acp probe on WSL2

Checklist

  • One focused change
  • npm run typecheck passes
  • npm run lint passes
  • npm run format passes
  • QA evidence
  • Tests added or updated where it made sense

Cursor ACP only reports thought_level for the current model, so the catalog was copying Haiku's Off/On onto Grok 4.6 until the next probe happened to land on Grok.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extracts per-model ACP thinking-option discovery into a shared resolver and enables it for Cursor while retaining Kimi’s existing opt-in behavior.

  • Probes each advertised model through the catalog session to derive model-specific thinking options.
  • Clears inherited thinking metadata when a non-current model probe fails while retaining valid session metadata for the current model.
  • Adds Cursor coverage for mixed thinking-option sets, probe failures, and the single-model fast path.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/server/src/server/agent/providers/acp-agent.ts Adds the shared per-model thinking catalog resolver and safely removes inherited metadata from failed non-current model probes.
packages/server/src/server/agent/providers/cursor-acp-agent.ts Opts Cursor catalog discovery into the shared per-model resolver.
packages/server/src/server/agent/providers/kimi-acp-agent.ts Replaces Kimi’s local resolver implementation with the equivalent shared resolver.
packages/server/src/server/agent/providers/cursor-acp-agent.test.ts Covers model-specific options, single-model discovery, and both current and non-current probe failures.
packages/server/src/server/agent/providers/kimi-acp-agent.test.ts Updates failed-probe expectations to ensure foreign thinking options are omitted.

Sequence Diagram

sequenceDiagram
  participant C as Catalog discovery
  participant A as Cursor or Kimi ACP
  C->>A: session/new
  A-->>C: models and current model options
  loop Each advertised model
    C->>A: session/set_config_option(model)
    alt Probe succeeds
      A-->>C: model-specific thought_level options
      C->>C: Store options on that model
    else Probe fails
      A-->>C: Error
      C->>C: Retain current-model session options or omit metadata
    end
  end
  C-->>C: Publish resolved catalog
Loading

Reviews (2): Last reviewed commit: "fix(server): drop inherited thinking opt..." | Re-trigger Greptile

Comment thread packages/server/src/server/agent/providers/acp-agent.ts Outdated
…e fails

A rejected model switch was leaving the probe session's thinking list on the failed model, so Grok could still advertise Haiku's Off/On.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Cursor thinking menu shows Off/On for Grok 4.6

1 participant