fix: 隔离 Guardrail 拦截后的原始结构化输出 - #59
Open
Shuhong-BNU wants to merge 10 commits into
Open
Conversation
feat(core-agent): add PR summary generator
…ao-guardrail-coverage-auditor feat(Core-Agent): add guardrail coverage auditor for unfeat(Core-Agent): add guardrail coverage auditor for ungated write toolsgated write tools
…ding-skill feat: add paper reading skill
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
问题
当前 Agent Harness 会对完整
structured_output执行输出 Guardrail 检查。当 Guardrail 命中时,用户可见的
final_output已经会替换为安全提示,但原始structured_output仍会:AgentRun.structured_outputmessage.completedSSE 发送给前端因此,被 Guardrail 拦截的内容仍可能通过持久化数据或结构化事件继续暴露。
修改
message.completed不再携带原始 blocked payloadguardrail.triggered、安全提示和output_guardrailstop reason本次修改只收紧 Guardrail 命中后的输出边界,不改变 Guardrail 检测规则。
测试
覆盖:
AgentRun.structured_outputmessage.completedSSE 暴露output_guardrailstop reason 保持不变实际执行:
2 passed26 passed, 2 failed;两项失败均来自当前upstream/main的既有 API 测试问题(router.py中未定义的conversation,以及一项响应文案断言不一致)py_compile:通过git diff --check:通过影响范围
本次仅修改 Agent Harness 的 Guardrail 输出处理和对应回归测试。
不修改: