Skip to content

fix(transport): preserve JSON strings across stdio frames - #43

Merged
Harold Hunt (huntharo) merged 1 commit into
mainfrom
fix/json-rpc-stdio-framing
Nov 16, 2026
Merged

Harold Hunt (huntharo) merged 1 commit into
mainfrom
fix/json-rpc-stdio-framing

Conversation

@huntharo

@huntharo Harold Hunt (huntharo) commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On Node 24.22.1, node:readline splits literal U+2028/U+2029 inside valid JSON strings. The resulting fragments are discarded by JsonRpcConnection, leaving requests to time out.

Frame protocol stdout on LF only through a shared readJsonRpcLines reader. Preserve split UTF-8 characters, accept CRLF and final EOF tails, and leave process ownership and stderr behavior with callers. Malformed messages now produce content-free diagnostics. Includes a patch changeset.

Verification

  • Confirmed the property/oracle regression fails against pre-fix code on Node 24.22.1, then passes after the fix.
  • Generated arbitrary UTF-16 string contents and byte partitions, plus exhaustive split points for a representative frame.
  • Round-tripped a synthetic 1,295,500-byte Unicode response while flooding stderr, then completed another request on the same process.
  • Verified the SDK-backed ACP connection over real subprocess stdio.
  • Passed pnpm build, full pnpm test, pnpm typecheck, pnpm lint:boundaries, pnpm lint:deps, and pnpm lint:licenses; reran the transport suite and typecheck after final test changes.

Notes

This is a backward-compatible patch release for LF/CRLF-delimited JSON-RPC and can ship independently of the PwrAgent caller PR.

The owning source and protocol stdout caller audit are recorded in docs/stdio-framing.md. No Codex private storage was read, and no shared App Server was stopped or restarted.

@huntharo
Harold Hunt (huntharo) merged commit dc95782 into main Nov 16, 2026
2 checks passed
@huntharo
Harold Hunt (huntharo) deleted the fix/json-rpc-stdio-framing branch November 16, 2026 18:53
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