Skip to content

fix(controls): send a thinking level as the model's effort/reasoning param (#119) - #150

Merged
justin-carper merged 3 commits into
mainfrom
fix-thinking-param-119
Oct 28, 2026
Merged

justin-carper merged 3 commits into
mainfrom
fix-thinking-param-119

Conversation

@justin-carper

Copy link
Copy Markdown
Collaborator

Summary

Fixes #119. When a model can't take a thinking level, the provider now sends it as the param the model actually reads. Example: thinking: medium on grok-4.6 was sent unchanged; Cursor ignored it and ran at its default (high). The provider now sends effort: medium.

Behavior

  • resolveControls takes the model's advertised params. If thinking isn't a valid value of the model's thinking param, or the model has none, it moves to the first reasoning param (effort/reasoning) that accepts the value. xhigh maps to extra-high where Cursor spells it that way.
  • An explicit value on any effort/reasoning param wins; thinking is dropped.
  • A value nothing accepts is left in place, and the warning lists the accepted values.
  • If the model's params aren't known (no discovered catalog), nothing changes.
  • The language model reads the model's params once per instance from the latest discovered catalog (falling back to the built-in list), and logs each adjustment once via warnOnce.
  • The delegate and cloud tools are unchanged; their thinking arg is already documented as true/false only.

Verification

  • npm run prepublishOnly: 656 tests pass, typecheck + build OK.
  • New tests: 9 in test/controls.test.ts, plus 1 in test/language-model.test.ts that seeds a catalog and asserts grok-4.6 receives effort: medium.
  • Mutation checks: removing the remap, the catalog wiring, or the any-param explicit check each fails a named test.
  • Not run: a live Cursor turn. The premise that Cursor ignores params a model doesn't advertise comes from the grok 4.6 thinking/reasoning level #119 report.

Closes #119

…param (#119)

Cursor ignores params a model doesn't advertise, so "thinking": "medium"
on grok-4.6 silently ran at Cursor's default (high). When the discovered
catalog shows the model's thinking param can't carry the value, resolveControls
moves it to the model's reasoning-level param (effort/reasoning; xhigh ->
extra-high where needed) and the language model logs a one-time warning.
An explicit effort/reasoning value still wins; unknown catalogs are unchanged.
…param win

Review round 1: a language-model test now seeds models-latest.json and asserts
grok-4.6 receives effort:medium, so unplugging the catalog lookup fails a test.
An explicit value on any reasoning param (not only the first) now suppresses
the thinking remap.
@justin-carper
justin-carper merged commit b7108ac into main Oct 28, 2026
8 checks passed
@justin-carper
justin-carper deleted the fix-thinking-param-119 branch October 28, 2026 17:43
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.

grok 4.6 thinking/reasoning level

1 participant