Skip to content

chore(deps): codex-headless proxy mirror writes chunks as base64 (Refs #372) - #1317

Merged
Juliusolsson05 merged 2 commits into
mainfrom
chore/codex-headless-mirror-b64
Sep 25, 2026
Merged

Juliusolsson05 merged 2 commits into
mainfrom
chore/codex-headless-mirror-b64

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Refs #372. #372 stays open for per-file caps, dropped counters, request-body mirroring and the synchronous write.

Bumps packages/codex-headless ae0e935 → d7d7a5d, the merge of Juliusolsson05/codex-headless#53. That range holds only #53's commits: plan, fix and two test commits. No package.json or lockfile change, so there is no lockfile resync.

Why

Codex proxy dumps (~/.config/agent-code/proxy/**/proxy-events.jsonl) have stored every response chunk as a decimal byte array. JSON.stringify runs Buffer#toJSON before the mirror's replacer sees the value. That is 3.65× the payload: in one recorded session file, 2,266 MiB of chunk lines held 621 MiB of bytes. A later snapshot of the same session measured 3.646×.

What merges

  • Chunks are mirrored as base64 ({ _buffer_b64 }), as API.md always documented. The recorded bytes round-trip unchanged.
  • For new sessions, chunk lines shrink to about 0.38× their old size. The same bytes re-encoded would take about 869 MiB instead of 2,266 MiB; the base64 alone is about 830 MiB, plus about 110 bytes of framing per event.
  • Files already on disk are not rewritten, and they stay decimal until retention prunes them.
  • No app code reads the chunk encoding. Debug bundles ship the raw 5 MiB tail, which now fits more events. The live adapter still gets the in-memory Buffer.

Tests

Package: responsesProxy.mirror.test.ts passes (6 tests), including the recorded chunk, a full-size chunk, a nested Buffer and a split UTF-8 chunk. The app diff is the gitlink only. npx tsc -b is clean.

Review

Three reviewers checked this app PR (A pointer and metadata, B app integration, C measurement). The package PR's own disposition is on codex-headless#53. Its fixture was sanitized under steering q36.

Residual

The proxy mirror still has no per-file cap and no dropped-write counter. It still mirrors request bodies, and it still writes synchronously inside emit (#372).

🤖 Generated with Claude Code

Juliusolsson05 and others added 2 commits September 25, 2026 09:41
@Juliusolsson05 Juliusolsson05 changed the title chore(deps): codex-headless proxy mirror writes chunks as base64 (refs #372) chore(deps): codex-headless proxy mirror writes chunks as base64 (Refs #372) Sep 25, 2026
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Final disposition (pre-merge), head 45fffac. Three independent reviewers, one round each, on the app PR: A (pointer and metadata), B (app integration), C (measurement and forensic value). The package change has its own disposition on codex-headless#53, merged as d7d7a5d.

Reviewer Round 1 Round 2
A (pointer, metadata) FIX-BEFORE-MERGE —
B (app integration) MERGE-READY —
C (measurement) MERGE-READY —

I checked the pointer myself. The head's packages/codex-headless is d7d7a5d, the merge commit of codex-headless#53 (state MERGED), and the only file in the app diff.

Findings and dispositions:

  • A, minor: the title and the commit subject said lowercase (refs #372), and the commit has no Refs #372 trailer.
  • B: no findings. B noted two gaps in the app's existing tests; this PR does not touch that code, so neither is a regression here:
    • the debug-bundle tests mock the proxy reader;
    • the Codex launch tests run with useProxy: false.
  • C, minor: the body's "those chunk lines drop to about 830 MiB" was wrong on two counts.
    • It is the base64 payload alone. With the per-event framing, C measured about 869 MiB.
    • Files already on disk are never rewritten; only sessions started after the bump write base64.
    • Fixed in the replacement body. The same sentence in the package plan doc (codex-headless) is not changed.
  • C, package test gaps (belong to fix(activity): close stuck flags from JSONL replay at bootstrap_complete #53): no test makes the mirror write throw, and a mutant that skips super.emit survives. Not fixed here.

Residuals:

Merges through batch PR #1318 once every member passes its gate.

🤖 Generated with Claude Code

@Juliusolsson05
Juliusolsson05 merged commit cfbaa0c into main Sep 25, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the chore/codex-headless-mirror-b64 branch September 25, 2026 18:02
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