Skip to content

fix: handle Cursor Auto (default) and cursor-grok reasoning models - #4

Open
cosmyo wants to merge 1 commit into
offbynan:mainfrom
cosmyo:fix/default-and-cursor-grok-reasoning
Open

fix: handle Cursor Auto (default) and cursor-grok reasoning models#4
cosmyo wants to merge 1 commit into
offbynan:mainfrom
cosmyo:fix/default-and-cursor-grok-reasoning

Conversation

@cosmyo

@cosmyo cosmyo commented Aug 12, 2026

Copy link
Copy Markdown

Problem

Two related bugs break Cursor models when Pi has a non-off default thinking level (e.g. defaultThinkingLevel: "medium" in settings):

1. Cursor Auto (default)

supportsReasoningModelId("default") returned true, so with defaultThinkingLevel: "medium" the proxy rewrote defaultdefault-medium. Cursor rejects that model id with Provider finish_reason: error.

Repro

  1. Set defaultProvider: "cursor", defaultModel: "default", defaultThinkingLevel: "medium"
  2. Start Pi and send any prompt
  3. First request fails with 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 to cursor-grok-4.5 with an effort map, but:

  • supportsReasoningModelId() did not recognize the cursor-grok-* prefix (regex expects bare grok-)
  • effort mapping lived in compat.reasoningEffortMap, but Pi reads model.thinkingLevelMap
  • without effort suffix, requests sent bare cursor-grok-4.5, which is invalid

Fix

  • supportsReasoningModelId: return false for default; recognize cursor-grok-*
  • modelConfig: set thinkingLevelMap from deduped effort map; mark effort-deduped models as reasoning: true
  • resolveModelId: skip effort insertion for default; default bare cursor-grok-* to medium when no effort is provided

Tests

  • Updated default reasoning expectation
  • Added buildThinkingLevelMap coverage
  • Added cursor-grok-4.5 dedup + thinking map tests
  • Added resolveModelId tests for default and cursor-grok-*

All 93 tests pass locally.


Note: upstream issues appear to be disabled, so this PR doubles as the bug report. Happy to split or adjust if there's a preferred reporting channel.

- 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
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