Skip to content

fix(agent): preserve NUL characters in archived tool output - #6872

Merged
M4n5ter merged 1 commit into
apache:rust-previewfrom
sunrioa:codex/fix-shell-archive-nul
Nov 13, 2026
Merged

M4n5ter merged 1 commit into
apache:rust-previewfrom
sunrioa:codex/fix-shell-archive-nul

Conversation

@sunrioa

@sunrioa sunrioa commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

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

  • The standalone facts suite passed all 32 tests on macOS, including a regression that reconstructs the original Shell output across archive pages containing NUL characters.
  • An offline replay of the same investigation reproduced the archive error before the fix. With the archive and completion fixes applied, the worker reached its next model step, submitted a result, and released the slot.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex assisted with diagnosis, implementation, the regression test, offline replay, and drafting.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes
  • No
简体中文

Shell 输出含有 NUL 字符时,归档分页可能导致模型请求准备失败。现在,结构化工具输出里的 NUL 会保留,并随分页结果正常编码为 JSON。普通文件的二进制文本读取校验仍然适用。

macOS 上 facts 套件 32 项全过,其中的回归用例验证可以从含 NUL 的归档分页还原原始 Shell 输出。同一轮调查的离线重放复现了归档错误。应用归档和收尾修复后,调查进入下一次模型调用、提交结果并释放调查位。

OpenAI Codex 协助了诊断、实现、回归测试、离线重放和正文起草。

@M4n5ter
M4n5ter merged commit a789323 into apache:rust-preview Nov 13, 2026
9 checks passed
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.

2 participants