Repository navigation
fix(auth-cursor): map reasoning effort and service tier onto Cursor model params - #1
Merged
Conversation
…odel params Cursor names the reasoning knob per model: reasoning_effort on some Claude models, effort on others, reasoning on Kimi K3. Only reasoning_effort was forwarded, so effort requests for the rest were dropped and those models always ran at their catalog default. - Offer the requested reasoning effort to a model's effort/reasoning parameter when it has no reasoning_effort, and map "none" to thinking=false where the model exposes thinking. - Map service_tier "priority" to fast=true. /v1/responses callers lose service_tier in the host's chat translation, so fall back to the original request body.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Cursor's model catalog names the reasoning knob differently per model. On one account today:
reasoning_efforteffort(opus alsofast, fable alsothinking)reasoning(low/high/max)chatParamsonly producesreasoning_effort, andresolveModelSelectiondrops ids a model does not expose. So a client's reasoning effort was silently ignored for opus, fable and kimi, which always ran at their catalog default. There was also no way to request Opus fast mode.Change
resolveModelSelectionoffers the requestedreasoning_effortto a model'seffortorreasoningparameter when the model has noreasoning_effort. Allowed-value filtering is unchanged: a value the model does not list is still dropped.nonesetsthinking=falseon models that exposethinking; any other effort setsthinking=true.service_tier: "priority"maps tofast=true, forwarded only where the model has afastparameter. The host's Responses-to-chat translation dropsservice_tier, sobuildGenerateRequestfalls back toExecutorRequest.OriginalRequestfor /v1/responses callers.Testing
gofmt -lclean,go vet ./...clean, c-shared build OK,go test -race ./...passes.effort/reasoning, unlisted value dropped,nonetothinking=false,fastforwarded or dropped by model,service_tiermapping, and the OriginalRequest fallback./v1/responseson a real account (output tokens on a fixed math prompt, low vs max): opus 172 vs 630, fable 196 vs 516; before this change opus stayed at 205-263 for both. Opus withservice_tier: "priority"streamed about 250 tok/s vs about 95 tok/s without it (3 runs each, same prompt).