fix(consult): 每一轮回答前都必须调用排盘工具
Independent Staging Quality Gate / validate (push) Successful in 9m22s
Independent Staging Quality Gate / publish (push) Successful in 13m39s

This commit is contained in:
jesse-ux
2026-09-17 14:21:33 +08:00
parent 6d097de95b
commit dc2f2a16bb
10 changed files with 155 additions and 12 deletions
@@ -0,0 +1,33 @@
# 进度 · 咨询追问轮必须先调排盘工具(2026-09-17)
基线:`origin/staging` @ `6d097de9`
分支:`codex/consult-followup-tool-contract-20260917`
BUG922、923。Skill 未 bump。
## 做了什么
- **T1 / BUG-922**:删掉本命与窗口两处「简单追问可复用 existing packet/context」。`frontend/src` 已无 `follow-ups may use`
- **T2 / BUG-923**`consultationNatalPrepareStep` 第 0 步 `toolChoice: "required"`。新增 `consultationWindowPrepareStep`,申报时段首次 stream 与合同 retry 走 `windowStreamOptions``retryForAnswer` / 续写 / 分段不带强制。
- **prepareStep 类型**`@mastra/core/dist/agent/types.d.ts``toolChoice``'auto' | 'none' | 'required' | { type: 'tool'; ... }`。本仓接受 `"required"`,未升级依赖。源码注释里曾写「思考模式供应商拒 named/required」;产品拍板每轮必调工具,仍上 `required`。若某模型线上拒收,另立单。
- **T4 第一轮取证**(执行方无 VPS,留给产品/部署):
```bash
cd /opt/jyotisha-production
docker compose -f deploy/docker-compose.server.yml logs web --since 2026-09-17T00:00:00 \
| grep agent-observability | grep '<该会话的 sessionId>' | head
```
三条 `run.failed` 若都没有 `tool` 步骤,即本单同一根因;若第一轮有 `tool``status: failed`,另立单。
## 测试
| 项 | 结果 |
| --- | --- |
| `tsc --noEmit` | 0 错 |
| 改动文件 eslint | 0 error |
| `consultation-workflow-contract` + voice | **14 passed / 0 fail**(含 BUG-922/923 契约) |
| `consultation-agentic-runtime` / `consultation-birth-time-mode` | 本机 Windows EPERM symlinkskill runtime alias),Linux CI 不受影响。断言已写在这两个文件里。 |
| Python | 未改 |
| 客户端 bundle | 未改,gzip 应为 0 |
T4 第一轮失败原因需 VPS `agent-observability` 日志,本机做不了。
+1 -1
View File
@@ -129,7 +129,7 @@
| `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 容器日志) | 待领取 | |
| `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 容器日志) | 待验收 | `codex/consult-followup-tool-contract-20260917` |
### 个人报告