fix(rectification): stop forcing named tool_choice on thinking models
Homepage opening failed immediately because thinking-mode providers reject a required first-tool choice. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4199,3 +4199,19 @@
|
||||
- 相关记录:BUG-266(同一 runner 上的磁盘耗尽与 6 小时网络 prune)、BUG-264(本地全量 `npm test` 并发跑 `database-*` fixture 的既有抖动)
|
||||
- 复发自:BUG-266(回收只覆盖磁盘与 6 小时以上空网络,未覆盖地址池)
|
||||
- 修复版本:待提交
|
||||
|
||||
## BUG-282 | 生时纠正 opening 强制 named tool_choice,thinking 模型立刻 run.failed
|
||||
|
||||
- 状态:resolved(本地修复,待提交与发布)
|
||||
- 首次发现:2026-08-18
|
||||
- 最近更新:2026-08-18
|
||||
- 影响面:staging 首页进入生时纠正、`POST /api/rectification/agent` 的 `action=opening`、V10 `runV9AgentTurn` 第一步 `prepareStep`
|
||||
- 用户现象:从首页进入生时纠正后流立即结束。NDJSON 只有 `run.started` 接着 `run.failed`,没有 `skill.bound`、`case.loaded` 或任何回答增量。
|
||||
- 触发条件:登录后从首页打开生时纠正;当前会话模型处于 thinking/reasoning 模式。
|
||||
- 根因:runner 为了保证第一步读取 Case,把 `prepareStep` 设成 `toolChoice: { type: "tool", toolName: "rectification-read-case" }`。上游 thinking 模式拒绝任何非 auto 的 `tool_choice`,返回 `Thinking mode does not support this tool_choice` 且 `isRetryable: false`。该错误被压成泛化 `run_failed`,客户端因此只看到两个公开事件。鉴权、Case 绑定和 turn 创建都已成功,失败发生在第一次 provider 调用。
|
||||
- 修复:第一步仍只暴露 `rectification-read-case`,但 `toolChoice` 改为 `"auto"`。运行器继续拒绝在 `case.loaded` 之前调用其他公开工具。provider 若仍返回该原文,错误码改为可诊断的 `thinking_tool_choice_unsupported`,并写一条不含正文的 attempt 失败日志。
|
||||
- 验证:`rectification-v9-agent.test.ts` 断言第一步为 `activeTools=["rectification-read-case"]` 且 `toolChoice="auto"`;`rectification-v9-stream.test.ts` 新增 thinking-mode 拒绝用例,确认只尝试一次、公开事件仍是 `run.started`/`run.failed`、attempt 错误码为 `thinking_tool_choice_unsupported`。
|
||||
- 防复发:thinking 模式不能发送 named 或 required `tool_choice`。需要限制第一步工具时,用 `activeTools` 收窄集合,把选择权留给 auto;真实读取门禁继续由 runner 在 `case.loaded` 之前拦截其他公开工具。
|
||||
- 相关记录:BUG-261
|
||||
- 复发自:无
|
||||
- 修复版本:待提交
|
||||
|
||||
Reference in New Issue
Block a user