fix: 防止 thinking 泄漏到 operator-visible 投影#2149
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jolestar
left a comment
There was a problem hiding this comment.
LGTM. Well-scoped fix that correctly addresses thinking/reasoning leakage into operator-visible projections.
Summary of review:
-
Brief text canonical source (client.ts, runtime-store.ts) — Correctly makes persisted
BriefRecord.textthe single source of truth for brief display, removing the transcript-based text extraction that was concatenating all block types including thinking. Clean removal oftranscriptEntryText()from both files. -
Verbose assistant round filtering (session-reducer.ts) — The
type === "text"filter intranscriptEntryText()is the minimal correct fix: only operator-visible text blocks are projected, while thinking/reasoning/tool_use blocks are excluded. -
Response language contract (prompt/mod.rs) — Moving
response_language_section()to the last position gives it proper recency weight. The rewritten contract with 4-level precedence and explicit coverage of tool-published prose (PR reviews, comments, issue bodies) is a meaningful improvement. -
Test coverage — Excellent: 3 new test suites covering all three change areas with targeted assertions. Rust tests updated for new ordering.
No blocking issues found.
150b8f9 to
70f7312
Compare
变更概述
lastBrief统一以持久化BriefRecord.text为 canonical content,不再从 transcript 拼接正文assistant_round_recorded只投影 assistanttextblock,避免thinking、reasoning与 tool block 泄漏到 operator-visible 文本根因
GUI 的多条 brief 展示路径优先或允许使用关联 transcript;通用 transcript 文本提取又拼接了所有带
text/content的 block,导致 thinking 与最终答复混合。与此同时,弱模型可能在工具参数中生成英文的人类可读 review 文本,并通过 command preview 回灌后续上下文。验证
cargo fmt --all -- --checkRUSTFLAGS="-D warnings" cargo check --all-targetscargo testcargo test --lib response_language