Repository navigation
fix(cursor): make Auto's Optimize For selectable as Thinking - #568
Conversation
cursor-agent 2026.10 reports Auto as `auto-smart` with one `model_config` parameter, `optimize_for` (Intelligence / Balance / Cost), and no `thought_level` parameter. Host therefore offered Auto no Thinking choices and baked the current value into the Model Ref (`auto-smart[optimize_for=balanced]`), so the router preference could not be changed from the Composer. Present `optimize_for` as Auto's Thinking options and keep it out of the Model Ref so a changed preference still resolves to a catalog model. Legacy Refs that carried the parameter are still accepted. Signed-off-by: Vincent <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
📝 Summary
Merge Risk: ⚪ Minimal · up to
|
|
已合并( 把 Auto 的 |
Summary
新版 Cursor CLI(实测
cursor-agent 2026.10.01,启用了 Smart Auto 的账号)里,Auto 模型的 ACP 原生值变成auto-smart,并且只带一个参数:{ "id": "optimize_for", "name": "Optimize For", "category": "model_config", "currentValue": "balanced", "options": [{ "value": "intelligence", "name": "Intelligence" }, { "value": "balanced", "name": "Balance" }, { "value": "cost", "name": "Cost" }] }它没有任何
thought_level参数。Cursor 原生 UI 把它作为 Auto 的 “Optimize For” 选项(Intelligence / Balance / Cost)。根因:Cursor adapter 只把
thought_level参数映射为 Thinking,model_config参数则写进 Model Ref。因此:auto-smart[optimize_for=balanced])。即使原生值被改动,生成的 Ref 也不在 catalog 中,选择无法被确认。直接用 ACP
session/set_config_option设置optimize_for=intelligence/cost,Cursor 均正常确认,说明问题在 Host 侧的映射。改动(只改
packages/adapters/cursor-cli):thinking.ts:新增isCursorThinkingOption。除thought_level外,model_config中按 id 列出的optimize_for也作为 Thinking 选项提供(标签沿用原生名称 Intelligence / Balance / Cost)。models.ts:cursorConfiguredModelRef不再把作为 Thinking 的参数写进 Model Ref,Auto 的 Ref 为auto-smart。context、fast等其他model_config参数仍保留在 Ref 中,行为不变。auto-smart[optimize_for=…]Ref 仍可通过已有的 legacy 解析恢复。说明:
optimize_for,没有把所有model_config参数泛化为 Thinking,避免context/fast这类参数改变语义。Related issues
N/A
Test plan
自动测试:
npx vitest run --config tests/vitest.config.js packages/adapters/cursor-cli:18 个文件、183 个测试通过。capabilities.test.ts新增 3 个用例(fixture 取自cursor-agent 2026.10.01实际返回的 Auto 参数):auto-smart,默认 Thinking 为当前原生值;其他model_config参数仍在 Ref 中。thinking.select写入optimize_for=intelligence,确认后effectiveModel仍是 catalog 中的auto-smart。auto-smart[optimize_for=cost]仍解析为model=auto-smart+optimize_for=cost。npm run typecheck、npx eslint packages/adapters/cursor-cli、node tools/check-boundaries.mjs、prettier --check:通过。实机(macOS arm64):
cursor-agent 2026.10.01-e373342(Smart Auto 账号),codexhost 0.13.3 + 本 PR 的 cursor-cli plugin,调用 adapterinspect()(只读取模型列表,不发送 prompt):auto-smart[optimize_for=…],Thinking 选项为空。auto-smart,Thinking["Intelligence","Balance","Cost"],默认值与原生currentValue一致;其余 45 个模型的 Ref 和 Thinking 不变。cursor-agent 2026.10.19-6bbf2c4,未启用 Smart Auto 的账号:Auto 仍为default且没有参数,新旧 plugin 输出一致(无回归)。