Guard main assistant protocol tag leakage - #6596
Closed
yiliang114 wants to merge 1 commit into
Closed
Conversation
Collaborator
Author
|
Superseded by #6603, which contains the implementation patch and focused validation. Closing this plan-only draft so review stays on the active fix PR. |
Collaborator
Author
|
Closed in favor of #6603. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Adds a WIP design note for guarding normal main assistant turns against visible protocol-tag leakage such as
<analysis>and<summary>. This PR intentionally does not implement the runtime guard yet; it records the proposed scope and validation plan before code changes.Why it's needed
Issue #6595 describes cases where
qwen3.7-maxmay emit internal analysis or summary tags in a normal assistant response. If that response is recorded into history, it can contaminate future prompts, replay, and compaction. The planned fix is to discard the abnormal assistant response and retry from the clean pre-response history instead of letting the leaked tags enter context.Reviewer Test Plan
How to verify
Review the plan and confirm it scopes the first implementation to pure-text main assistant responses, excludes expected compression side-query scratchpad output, and requires tests proving rejected responses do not enter history or JSONL.
Evidence (Before & After)
N/A. This is a planning-only draft PR with no runtime behavior change.
Tested on
Environment (optional)
N/A.
Risk & Scope
<summary>, and expected compression side-query output.Linked Issues
Related to #6595.
中文说明
What this PR does
新增一份 WIP 设计说明,用来规划如何防止普通主对话 assistant turn 泄漏
<analysis>、<summary>等内部协议标签。本 PR 暂不实现运行时代码,只先记录方案范围和验证计划。Why it's needed
#6595 描述了
qwen3.7-max在部分场景下可能把内部分析或摘要标签输出到普通 assistant response 中的问题。如果这类 response 被写入 history,会污染后续 prompt、replay 和 compact。计划中的修复方向是丢弃异常 assistant response,并从异常 response 之前的干净 history 自动 retry,而不是让泄漏标签进入上下文。Reviewer Test Plan
How to verify
阅读计划文档,确认第一版实现范围限定在纯文本主 assistant response;不会拦截预期的 compression side-query scratchpad 输出;并且要求测试证明被拒绝的 response 不会进入 history 或 JSONL。
Evidence (Before & After)
N/A。本 PR 仅包含计划文档,没有运行时行为变化。
Tested on
Environment (optional)
N/A。
Risk & Scope
<summary>和预期的 compression side-query 输出。Linked Issues
关联 #6595。