Repository navigation
fix(agent): preserve NUL characters in archived tool output - #6872
Merged
Merged
Conversation
Generated-by: OpenAI Codex
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.
Summary
A Shell result containing a NUL character can fail during model request preparation when its archived output is paged. Preserve the character in structured tool output and encode it normally in the resulting JSON page. Binary files still follow the existing text-read validation.
Verification
AI use
Tool(s) and scope: OpenAI Codex assisted with diagnosis, implementation, the regression test, offline replay, and drafting.
Checklist
Does this PR entail a change in behavior?
简体中文
Shell 输出含有 NUL 字符时,归档分页可能导致模型请求准备失败。现在,结构化工具输出里的 NUL 会保留,并随分页结果正常编码为 JSON。普通文件的二进制文本读取校验仍然适用。
macOS 上 facts 套件 32 项全过,其中的回归用例验证可以从含 NUL 的归档分页还原原始 Shell 输出。同一轮调查的离线重放复现了归档错误。应用归档和收尾修复后,调查进入下一次模型调用、提交结果并释放调查位。
OpenAI Codex 协助了诊断、实现、回归测试、离线重放和正文起草。