fix: handle Cursor Auto (default) and cursor-grok reasoning models - #4
Open
cosmyo wants to merge 1 commit into
Open
fix: handle Cursor Auto (default) and cursor-grok reasoning models#4cosmyo wants to merge 1 commit into
cosmyo wants to merge 1 commit into
Conversation
- Stop treating `default` as a reasoning model and skip effort suffixes in resolveModelId (fixes default-medium Provider finish_reason errors) - Recognize cursor-grok-* as reasoning models - Expose thinkingLevelMap from deduped effort variants for Pi - Default bare cursor-grok-* requests to medium effort in the proxy
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
Two related bugs break Cursor models when Pi has a non-
offdefault thinking level (e.g.defaultThinkingLevel: "medium"in settings):1. Cursor Auto (
default)supportsReasoningModelId("default")returnedtrue, so withdefaultThinkingLevel: "medium"the proxy rewrotedefault→default-medium. Cursor rejects that model id withProvider finish_reason: error.Repro
defaultProvider: "cursor",defaultModel: "default",defaultThinkingLevel: "medium"responseModel: "default-medium"2.
cursor-grok-4.5(reasoning / effort-only model)Cursor exposes only effort-suffixed variants (
cursor-grok-4.5-low,-medium,-high). After dedup they collapse tocursor-grok-4.5with an effort map, but:supportsReasoningModelId()did not recognize thecursor-grok-*prefix (regex expects baregrok-)compat.reasoningEffortMap, but Pi readsmodel.thinkingLevelMapcursor-grok-4.5, which is invalidFix
supportsReasoningModelId: returnfalsefordefault; recognizecursor-grok-*modelConfig: setthinkingLevelMapfrom deduped effort map; mark effort-deduped models asreasoning: trueresolveModelId: skip effort insertion fordefault; default barecursor-grok-*tomediumwhen no effort is providedTests
defaultreasoning expectationbuildThinkingLevelMapcoveragecursor-grok-4.5dedup + thinking map testsresolveModelIdtests fordefaultandcursor-grok-*All 93 tests pass locally.