Skip to content

fix: 防止 thinking 泄漏到 operator-visible 投影#2149

Merged
jolestar merged 1 commit into
mainfrom
fix-brief-thinking-language
Jul 10, 2026
Merged

fix: 防止 thinking 泄漏到 operator-visible 投影#2149
jolestar merged 1 commit into
mainfrom
fix-brief-thinking-language

Conversation

@jolestar

Copy link
Copy Markdown
Collaborator

变更概述

  • 让 Web GUI 的 newest brief、timeline brief 与 agent lastBrief 统一以持久化 BriefRecord.text 为 canonical content,不再从 transcript 拼接正文
  • verbose assistant_round_recorded 只投影 assistant text block,避免 thinkingreasoning 与 tool block 泄漏到 operator-visible 文本
  • 强化主模型响应语言契约,明确语言选择优先级,并覆盖工具发布或 artifact 携带的 review/comment/PR body 等 human-facing prose
  • 保持 best-effort:不增加额外 LLM 调用、语言检测、重试或 brief promotion 阻断

根因

GUI 的多条 brief 展示路径优先或允许使用关联 transcript;通用 transcript 文本提取又拼接了所有带 text/content 的 block,导致 thinking 与最终答复混合。与此同时,弱模型可能在工具参数中生成英文的人类可读 review 文本,并通过 command preview 回灌后续上下文。

验证

  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo check --all-targets
  • cargo test
  • cargo test --lib response_language
  • Web GUI runtime 定向测试:63 项通过
  • Web GUI typecheck
  • GPT 5.5 与 Qwen 3.7 Max 多场景 live probe

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
holon Ready Ready Preview, Comment Jul 10, 2026 12:06pm

@jolestar jolestar left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Well-scoped fix that correctly addresses thinking/reasoning leakage into operator-visible projections.

Summary of review:

  1. Brief text canonical source (client.ts, runtime-store.ts) — Correctly makes persisted BriefRecord.text the single source of truth for brief display, removing the transcript-based text extraction that was concatenating all block types including thinking. Clean removal of transcriptEntryText() from both files.

  2. Verbose assistant round filtering (session-reducer.ts) — The type === "text" filter in transcriptEntryText() is the minimal correct fix: only operator-visible text blocks are projected, while thinking/reasoning/tool_use blocks are excluded.

  3. 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.

  4. 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.

@jolestar jolestar force-pushed the fix-brief-thinking-language branch from 150b8f9 to 70f7312 Compare July 10, 2026 12:06
@jolestar jolestar merged commit b898846 into main Jul 10, 2026
5 checks passed
@jolestar jolestar deleted the fix-brief-thinking-language branch July 10, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant