Skip to content

providers: degrade undeclared reasoning levels down the declared ladder - #599

Open
guyu233 wants to merge 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/reasoning
Open

guyu233 wants to merge 4 commits into
caigee-cmd:mainfrom
guyu233:upstream/reasoning

Conversation

@guyu233

@guyu233 guyu233 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Problem

ResolveReasoningLevel only degraded max / xhigh; every other undeclared level fell through to ReasoningDefault, which can be higher than what the client asked for. none on a model that cannot disable thinking was especially wrong: it was promoted to the model default instead of the cheapest thinking tier.

Change

  • internal/providers/reasoning.go: one neutral ladder (none < low < medium < high < xhigh < max). A declared level is forwarded untouched; an undeclared level walks down to the nearest declared lower tier and never up; a request below the model floor lands on the cheapest declared tier instead of the default. Unknown levels still fall back to the default.
  • internal/providers/workbuddy/mapping.go: none on a model that cannot turn thinking off uses LowestThinkingOption (the cheapest thinking tier) rather than the default switch.
  • LowestThinkingOption added for adapters that need an explicit off request to become the lowest thinking tier.

release.yml's explicit-version input from the same original commit is not included; this PR is provider behavior only.

Tests

  • go test ./internal/providers/... passes.
  • reasoning_test.go covers declared, undeclared-lower, below-floor, unknown and none cases; WorkBuddy toggle tests cover the no-off model path.

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.

1 participant