Fix Cursor auto model Run routing#28
Open
chrythjin wants to merge 17 commits into
Open
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Add CURSOR_AUTO_MODEL constant and mergeAutoModel() in src/index.ts to ensure 'auto' is always registered in provider.models, deduplicated - Add CURSOR_AUTO_PROXY_MODEL constant and mergeAutoProxyModel() in src/proxy.ts to keep auto in proxy /v1/models without duplication - Update smoke tests: existence + single-occurrence assertions for auto across provider registration, refresh-before-discovery, and discovery fallback paths - Smoke tests and TypeScript build pass
Previously, when modelId was 'auto', the proxy omitted modelDetails from the Cursor RunRequest, causing 'Model details are required' errors via the private ConnectRPC path. This change adds resolveCursorRunModelId() which resolves 'auto' to the first discovered non-auto Cursor model before building ModelDetails. Explicit model IDs continue to pass through unchanged. The fix preserves cursor/auto as the user-facing model while ensuring the Cursor backend receives a valid explicit model ID. PR ephraimduncan#2 (closed): explored cursor/auto model support closes ephraimduncan#2
Capture recent Cursor auto-routing investigation notes and related memory for future reference. Made-with: Cursor
Drop local Serena memory and temporary session notes that were unintentionally included in the upstream pull request. Made-with: Cursor
Keep PR focused on cursor/auto runtime and smoke-test changes by dropping local docs/session artifacts and Serena project config files. Made-with: Cursor
Encode OpenAI model auto as Cursor's default Run model instead of collapsing it to the first discovered concrete model. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Summary
This fixes the OpenAI-compatible
model: "auto"path so the proxy preserves Cursor's own Auto routing when building theAgentService/Runrequest.Instead of resolving
autoto the first discovered concrete Cursor model, the Run payload now sends:requestedModel.modelId = "default"modelDetails.modelId = "default"modelDetails.displayModelId = "default"modelDetails.displayName = "Auto"modelDetails.displayNameShort = "Auto"Explicit model requests, such as
composer-2, are still forwarded unchanged through bothrequestedModelandmodelDetails.Why
The previous behavior collapsed OpenCode's
autorequest to the first discovered concrete model. That makesautodepend on discovery order and bypasses Cursor's native Auto model selection.Cursor's CLI default model lookup is not the same thing as Auto routing:
GetDefaultModelForClireturns a concrete CLI default, while the Run request'sdefaultmodel id lets Cursor perform its own routing decision server-side.Changes
auto-> first discovered model resolver.requestedModelto theAgentRunRequestpayload.model: "auto"as Cursor Run model iddefaultwith display nameAuto.modelDetailsandrequestedModelids.Verification
bun install --frozen-lockfilebun run buildbun test/smoke.tsThe smoke test now fails if
autois accidentally collapsed back to a discovered concrete model instead of being sent as Cursor'sdefaultRun model.