fix(consult): 第 0 步改回 auto,供应商 error 块不再被吞掉
BUG-937 撤回 thinking 模式下的 required toolChoice,只留 activeTools。BUG-938 让咨询流识别 Mastra error 块,公开码 calculation_failed,内部码进日志且不触发合同 retry。
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
# 进度 · 咨询第 0 步 required 修复单(2026-09-17)
|
||||
|
||||
工作树:`.worktrees/consult-followup-tool-contract-fix-20260917`
|
||||
分支:`codex/consult-followup-tool-contract-fix-20260917`
|
||||
基线:`origin/staging` @ `b51e7aff`(含 §2b:`gpt-5.6-luna` 接受 required,T2 第一优先)
|
||||
合入提交:`a370bd54`
|
||||
|
||||
## 任务状态
|
||||
|
||||
| 任务 | 状态 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| T2 / BUG-938 识别 Mastra `error` 块 | 完成 | 先做。`consumeAttempt` 遇 `error` 立即结束 attempt,内部码 `thinking_tool_choice_unsupported` / `provider_error`,公开码 `calculation_failed`,不进合同 retry |
|
||||
| T1 / BUG-937 第 0 步撤回 required | 完成 | `activeTools` + `toolChoice: "auto"`。跨供应商防护;§2b 反证该模型接受 required,不推翻 T1 |
|
||||
| T3 记录 | 完成 | BUG-937/938、BUG-923 防复发改写、CHANGELOG、本文件、README、走查清单 |
|
||||
| T4 部署后取证 | 环境缺口 | 无登录态 / 无模型凭据 / 无 VPS。清单在 `docs/testing/consult-followup-tool-contract-fix-20260917.md` |
|
||||
|
||||
未改 `page.tsx`、Python、Skill、`contractReady()`。
|
||||
|
||||
## 断言三栏
|
||||
|
||||
| 位置 | 原值 | 新值 | 原因 |
|
||||
| --- | --- | --- | --- |
|
||||
| `consultationNatalPrepareStep` 第 0 步 `toolChoice` | `"required"` | `"auto"` | BUG-282 至少一个 thinking 供应商拒收 required;BUG-937 |
|
||||
| `consultationWindowPrepareStep` 第 0 步 `toolChoice` | `"required"` | `"auto"` | 同上 |
|
||||
|
||||
## 测试
|
||||
|
||||
| 项 | 结果 |
|
||||
| --- | --- |
|
||||
| `tsc --noEmit` | 0 错 |
|
||||
| `npm run lint` | 0 error(118 warning,未动) |
|
||||
| `consultation-workflow-contract` | 含新契约 `prepareStep never sends required or named toolChoice` **绿** |
|
||||
| `agent-observability` | `provider_error` / `thinking_tool_choice_unsupported` 原样落日志 **绿** |
|
||||
| BUG-938 两条假流 | 隔离跑 **2 passed**(公开码 `calculation_failed`、无 `loading-method`、retry 不调用、`onError` 内部码)。整文件 `consultation-agentic-runtime.test.ts` 因 Windows `EPERM` skill symlink 无法加载,Linux 门禁不受影响 |
|
||||
| 全量 `npm test` | 本机 Windows **2541 / pass 2374 / fail 152 / skip 15**。失败以 Docker、`G:\G:\...` 双盘符 ENOENT、skill `EPERM` symlink 为主。任务点名的契约测试不在新增红里 |
|
||||
| `next build` | 本单未改客户端 bundle,gzip 预期 0。本机未重量(Windows worktree 构建常撞 skill symlink `EPERM`) |
|
||||
| Python | 未改 |
|
||||
|
||||
## §2b
|
||||
|
||||
同日 `gpt-5.6-luna` 本命路线接受过 `required`。T2 仍是第一优先:其它失败必须能从 `[consult-provider-error]` 看见原文。T1 保留,因为模型可切换,BUG-282 已实证过拒收。
|
||||
@@ -130,8 +130,8 @@
|
||||
| `TASK-rectification-tiebreak-card-loss-20260915.md` | `PROGRESS-rectification-tiebreak-card-loss-20260915.md` | **P0**:点卡上「再答两道参考题」交付卡消失(BUG-706);按钮亮但选项建不出变成裸题(BUG-708);旁白写「相对支持度」并与卡上入口打架(BUG-709)。卡上入口删除,出卡前收集,有活题时卡留下、采用置灰 | 待验收 | `codex/rectification-p0-20260915` |
|
||||
| `TASK-rectification-p0-fix-20260915.md` | `PROGRESS-rectification-p0-fix-20260915.md` | **验收修复单**:`f51e494c` 六条缺陷全部实现且方式正确,但 `page.tsx` 从 1951 涨到 1964 行,撞了 `chart-view-route.test.ts` 的 `<= 1951` 上限(AGENTS.md §6 增长冻结)。全量 fail 32→33,就这一条。门禁红很可能是 staging 停在 `2d7698ea`、6 个提交未部署的原因。修法是把 BUG-705 的十来行接线搬出 page.tsx,不放宽上限 | 待验收 | `codex/rectification-p0-fix-20260915` |
|
||||
| `TASK-settings-dialog-size-and-nav-20260915.md` | — | **复发单**:设置弹窗四个分区尺寸仍随内容跳变(BUG-698,复发自 BUG-554——旧防复发只查「有没有写 height」,查不到「写了没生效」);首要嫌疑是 `.settings-modal` 的 `dvh` 没有 `vh` 回退,不支持时整条 `height` 作废退化成内容高度,需先复现确认。另按产品要求去掉分区菜单左侧强调条,并拆开与悬停共用的选中态 | 待领取 | `codex/settings-dialog-size-and-nav-20260915` |
|
||||
| `TASK-consult-followup-tool-contract-20260917.md` | `PROGRESS-consult-followup-tool-contract-20260917.md` | 真机:申报时段会话连发「?」「你在说什么鬼」都 `run.failed runtime_contract_incomplete`,回执无任何 `tool` 步骤。根因是 Agent 系统指令写明「简单追问可复用已有 packet / context、不调工具」,而 `contractReady()` 要求每次请求恰好一次成功排盘调用;「已有 packet」跨请求并不存在(缓存只在单次请求内)。本命与窗口两个 Agent 同构。**产品拍板方案 1**:每轮必调工具(BUG-922 删例外句 + BUG-923 第 0 步 `toolChoice: required`);否决「没调工具就走不扣点纯对话」。第一轮正经问题为何失败留 T4 取证(回执只在 web 容器日志) | 已部署 `dc2f2a16`,但 BUG-923 的第 0 步 `required` 让全部咨询整轮失败(BUG-282 复发),由修复单撤回 | `codex/consult-followup-tool-contract-20260917` |
|
||||
| `TASK-consult-followup-tool-contract-fix-20260917.md` | `PROGRESS-consult-followup-tool-contract-fix-20260917.md` | **P0**。部署 `dc2f2a16` 后再聊天仍 `runtime_contract_incomplete`,回执只有 skill + retry。主根因(推断):BUG-923 把本命/窗口第 0 步改成 `toolChoice: required`,而首轮固定开 thinking,BUG-282 实证 thinking 模式供应商拒收非 auto 的 tool_choice → 每一轮咨询在第 0 步就被拒(BUG-937,复发自 BUG-282)。次根因(确定):咨询流不处理 Mastra `error` 块,拒收在回执/事件/日志三处都不可见,合同 retry 照跑同一参数(BUG-938)。T1 撤回 required 只留 activeTools + auto;T2 error 块 → 可诊断错误码、不进合同 retry;T4 部署后取证 | 待领取 | `codex/consult-followup-tool-contract-fix-20260917` |
|
||||
| `TASK-consult-followup-tool-contract-20260917.md` | `PROGRESS-consult-followup-tool-contract-20260917.md` | 真机:申报时段会话连发「?」「你在说什么鬼」都 `run.failed runtime_contract_incomplete`,回执无任何 `tool` 步骤。根因是 Agent 系统指令写明「简单追问可复用已有 packet / context、不调工具」,而 `contractReady()` 要求每次请求恰好一次成功排盘调用;「已有 packet」跨请求并不存在(缓存只在单次请求内)。本命与窗口两个 Agent 同构。**产品拍板方案 1**:每轮必调工具(BUG-922 删例外句 + BUG-923 第 0 步 `toolChoice: required`);否决「没调工具就走不扣点纯对话」。第一轮正经问题为何失败留 T4 取证(回执只在 web 容器日志) | 已部署但被 BUG-937 撤回 required,见修复单 | `codex/consult-followup-tool-contract-20260917` |
|
||||
| `TASK-consult-followup-tool-contract-fix-20260917.md` | `PROGRESS-consult-followup-tool-contract-fix-20260917.md` | **P0**。部署 `dc2f2a16` 后再聊天仍 `runtime_contract_incomplete`,回执只有 skill + retry。主根因(推断):BUG-923 把本命/窗口第 0 步改成 `toolChoice: required`,而首轮固定开 thinking,BUG-282 实证 thinking 模式供应商拒收非 auto 的 tool_choice → 每一轮咨询在第 0 步就被拒(BUG-937,复发自 BUG-282)。次根因(确定):咨询流不处理 Mastra `error` 块,拒收在回执/事件/日志三处都不可见,合同 retry 照跑同一参数(BUG-938)。T1 撤回 required 只留 activeTools + auto;T2 error 块 → 可诊断错误码、不进合同 retry;T4 部署后取证 | 待验收 | `codex/consult-followup-tool-contract-fix-20260917` |
|
||||
| `TASK-session-list-single-source-20260917.md` | `PROGRESS-session-list-single-source-20260917.md` | 会话列表一处数据源:本地 PG 兼容层 `order()` 只保留最后一键,`/api/sessions` 实际按 `id` 排、与游标不一致;`/` 与次级页两份数据源、`/` 每次回来重启动(产品拍板:首页与三个次级页进同一路由组,侧栏外壳与列表 provider 常驻 layout,不做 store);空「新对话」落库堆积(首页 50 条里 28 条);标题类别在后、同名靠墙钟 HH:MM。串行在 composer-guard 单之后。BUG 段 926 起 | 验收未通过 | `e4e73f56`(实现按任务书落地:多键排序 / `(app)` 路由组常驻外壳 / provider / 空会话不入列 + draft 复用 / 标题类别在前;两条让步任务书允许。**P1:4 条针对 `page.tsx` 的源码合同没跟着外壳搬家,`npm test` 在门禁里 `set -e` 下必红,staging 至今停在 `dc2f2a16`**。另:进度记录报「tsc 0 错」实为 2 错,只跑了定向测试。修复单 `TASK-session-list-single-source-fix-20260917.md`) |
|
||||
| `TASK-session-list-single-source-fix-20260917.md` | `PROGRESS-session-list-single-source-fix-20260917.md` | 验收修复单:F1 四条源码合同搬到 `(app)/layout.tsx` 两端对断(BUG-933);F2 两条陈旧 Python 入口断言(BUG-934,既有欠账);F3 无活跃会话时输入框静默吞发送(BUG-935);交付前必须跑全量测试 | 待验收 | `codex/session-list-single-source-fix-20260917` |
|
||||
| `TASK-first-paint-dead-screen-fallback-20260917.md` | — | 真机:首页永远停在「正在载入账户」,兜底全在没跑起来的 bundle 里(BUG-936 investigating)。根 layout 加与 bundle 无关的内联兜底 + 去掉本仓正则后行断言 | 待领取 | — |
|
||||
|
||||
Reference in New Issue
Block a user