feat(consult): one read-only evidence lookup per turn; settle open clauses at tool calls (BUG-1059)
read-consultation-evidence returns one closed-enum section (a formal varga, research/extended vargas, a Western layer, yogas, Ashtakavarga, Shadbala, transits, Chara Dasha, arudha, karakas, KP, gulika, kakshya, mahadashas, thematic evidence) from this request's finished calculation, never recalculates, answers unavailable on a cache miss and refuses a second call. The receipt records the step and the write row shows 「正在多看一眼:…」. A lookup after answer text went out keeps the released text whole: a verbatim restart is dropped as it arrives (40-char confirmation), a continuation is kept, and settlement still reads the step that wrote the answer; the lookup runs on the answer clock without resetting it. A length continuation carries the lookup result with the card. BUG-1059: the visible-text transformer's open clause is settled at each tool call, so unpunctuated narration no longer leaks into the answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
147ebc1789
commit
cb3ee55837
@@ -14201,3 +14201,18 @@
|
||||
- 相关记录:BUG-287(同一条 allowlist 曾经把分盘和审计表整段挡住;这次是嵌套键还没放行,不是「没算」复发)
|
||||
- 复发自:无
|
||||
- 修复版本:`codex/consult-evidence-card-20260927`(本地提交,未推送)
|
||||
|
||||
## BUG-1059 | 调工具那一步没写完的半句过程说明,会粘到下一步正文开头
|
||||
|
||||
- 状态:resolved(本地修复 `codex/consult-evidence-card-20260927`,待部署 staging;部署后补门禁 run 号)
|
||||
- 首次发现 / 最近更新:2026-09-27 / 2026-09-27
|
||||
- 影响面:`frontend/src/lib/stream-agent-response.ts` `consumeAttempt`(按步取答 `stepScopedAnswer`);本命与申报时段两条带工具的咨询路径。
|
||||
- 现象:数据卡实现(T5 补取工具)写测试时发现:模型在调用工具前写了一句不以句号 / 问号 / 换行收尾的过程说明(如「我先排一下盘:」「再看一眼 D60 分盘,」),这半句不会在那一步被丢掉,而是被原样接在下一步回答的第一句前面放给用户。用同一套真实 Agent + 假模型在修复前复现:回答以「我先排一下盘:」开头。
|
||||
- 触发条件:带工具的咨询轮,模型在调工具那一步写的过程说明最后一句没有句末标点。以句号收尾的过程说明(BUG-1053 测试用的样例)不受影响,所以 BUG-1053 的回归没拦住。
|
||||
- 根因:`createVisibleTextTransformer` 按句子边界放字,没收尾的半句留在它的缓冲里;这个缓冲按整次 attempt 共享、跨步保留。BUG-1053 的按步取答只丢掉「这一步里已经交给取答逻辑的文字」,调工具时没有把转换器里压着的半句一并结算,于是它在下一步第一次 `push` 时被冲出来,算作下一步(写回答那一步)的正文。
|
||||
- 修复:遇到 `tool-call` 块时先 `visible.finish("")` 结算这一步压着的半句:计算结果到手前的交给原来的「未签约文字」缓冲(降级材料不变);这一步已经放出过正文的(回答中途补取)当作正文续上,保证已放出的句子不被截断;其余都是过程说明,随这一步丢掉。
|
||||
- 验证:`frontend/tests/consult-evidence-lookup-20260927.test.ts`「BUG-1059: narration without closing punctuation before a tool call never leaks into the answer」(真实 `getJyotishAgent` + 记录提示词的假模型 + 公开 AA 盘真实引擎 golden),修复前失败、修复后通过;同文件「an open clause of released answer text before a lookup goes out whole」锁住另一面(回答中途补取时,已放出正文的半句照样完整放出)。BUG-1053 的 `consult-single-pass-answer-20260927.test.ts` 全部仍通过。
|
||||
- 防复发:按步取答的回归必须包含「过程说明不以句末标点收尾」的样例;任何在步边界丢弃文字的逻辑,都要连同 `createVisibleTextTransformer` 的缓冲一起结算。
|
||||
- 相关记录:BUG-1053(按步取答,本条补它漏掉的转换器缓冲)、BUG-1051(结算只认写回答那一步的 `stop`,不变)。
|
||||
- 复发自:无(BUG-1053 引入按步取答时留下的缺口)。
|
||||
- 修复版本:`codex/consult-evidence-card-20260927`(本地提交,未推送)
|
||||
|
||||
Reference in New Issue
Block a user