Skip to content

fix: pass through "auto" model identifier to Cursor API#8

Merged
anyrobert merged 1 commit intoanyrobert:mainfrom
sxin0:fix/auto-model-passthrough
Mar 14, 2026
Merged

fix: pass through "auto" model identifier to Cursor API#8
anyrobert merged 1 commit intoanyrobert:mainfrom
sxin0:fix/auto-model-passthrough

Conversation

@sxin0
Copy link

@sxin0 sxin0 commented Mar 14, 2026

Summary

When clients send model: "auto" (e.g. Claude Code CLI), the proxy now forwards it directly to Cursor CLI instead of treating it as unspecified and falling back to the last-used or default model. Cursor natively supports "auto" as a valid model identifier.

Root Cause

In resolve-model.ts, "auto" was explicitly excluded from being treated as an explicit model:

```ts
// Before
const explicitModel = requested && requested !== "auto" ? requested : undefined;
```

This caused "auto" to be dropped and replaced by lastRequestedModelRef.current or config.defaultModel.

Fix

"auto" is now detected and returned immediately, bypassing the fallback logic. It is intentionally not recorded in lastRequestedModelRef to avoid polluting model memory for subsequent requests.

Closes #7

Made with Cursor

@anyrobert anyrobert self-requested a review March 14, 2026 17:02
@anyrobert
Copy link
Owner

great jobs on this! lgtm!

@anyrobert anyrobert merged commit 549fee4 into anyrobert:main Mar 14, 2026
anyrobert added a commit that referenced this pull request Mar 20, 2026
fix: pass through "auto" model identifier to Cursor API
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.

Feature Request: Pass through auto model identifier to Cursor API

2 participants