Skip to content

feat(agent): add vision model routing - #15

Open
poluzhao wants to merge 3 commits into
CometixSpace:mainfrom
poluzhao:feat/vision-model-routing
Open

feat(agent): add vision model routing#15
poluzhao wants to merge 3 commits into
CometixSpace:mainfrom
poluzhao:feat/vision-model-routing

Conversation

@poluzhao

Copy link
Copy Markdown

Summary

  • Add a configurable vision-model fallback for Agent rounds that contain user images, image reads, or MCP/browser screenshots.
  • Return to the selected text model after image analysis while safely replacing historical image bytes with a textual placeholder.
  • Add sidebar configuration, validation, tests, and bilingual documentation for vision routing.

Test plan

  • pnpm --dir "Cursor++" run check-types
  • pnpm --dir "Cursor++" run lint
  • pnpm --dir "Cursor++" exec vitest run src/server/tests/visionRouting.test.ts
  • pnpm --dir "Cursor++" run package
  • Manually select a vision model in the Cursor++ sidebar and test user-image plus browser screenshot flows after restarting Cursor.

Move the image fallback selector above the provider list so users can find it without scrolling through long model configurations.
Rogers-F added a commit to Rogers-F/CCursor that referenced this pull request Aug 29, 2026
- getAutoCompactThreshold 改新公式: 窗口 − min(40K, 15%×窗口)
  (签名兼容保留 maxOutputTokens 形参但不再参与计算); 逐档值
  32K→27,200 / 64K→54,400 / 96K→81,600 / 128K→108,800 /
  258.4K→219,640 / 1M→960,000 — 32K/64K 死带消除; 净增长门槛 15K 与
  熔断判定不动
- 错误驱动压缩重试: isContextLengthLimitError 白名单分类
  (context_length_exceeded / maximum context length / prompt is too
  long / input token count exceeds 等 9 模式, 普通故障不误判) →
  performInlineAutoSummarize(budgetOverride=基准预算/2^retry) aggressive
  压缩 → 重发本轮请求 (round--), ≤CONTEXT_LENGTH_RETRY_MAX=3 轮硬封顶;
  基准预算由首次压缩的 plan.diagnostics.budgetTokens 回填
  (未压缩过时按 targetFloor=25%×窗口估计)
- 观测补全 ([AUTOCOMPACT] 结构化 log, 无 metrics 依赖): 压缩间隔样本
  (事故签名 4-5 分钟/次的直接检出器)、升级链/违约事件 (阶段 3 已含)、
  keepTail 构成含占位命中 (阶段 3 已含)、首次消费损失恒 0 计数
  (阶段 3 已含)、互斥争用计数 (阶段 3 已含)
- 测试: CometixSpace#15 错误分类白名单+aggressive 预算减半单调性 / CometixSpace#18 六档逐值
  断言 (含 32K/64K 死带消除); autoSummarize 存量阈值断言更新为新公式
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