Verified in this repo after ALF routed the equivalent report (cortexkit/anthropic-auth#158) here. Same defect, same cause.
What happens
previousBodies in packages/opencode/src/dump.ts:18 is a module-level Map. It is the only baseline the byte-diff has, so it dies with the process. Every dump written by a freshly started plugin carries diff: null.
Reproduced by dumping two requests in one module instance, then re-importing the module (a restart) and dumping a third:
request 2 (same process) diff=changed@63
request 3 (after restart) diff=NONE
Why this one matters more than it looks
The diff exists to answer one question: what changed on the wire between consecutive requests. The single most valuable instance of that question in this project has been the first request after a restart, because that is where prompt-cache busts concentrated — it is the reason openai-auth-sessions.json exists at all, persisting Codex thread ids so a restart does not mint a new prompt_cache_key.
So the instrument is blind on precisely the request it was built to explain. An operator restarts to test a fix, the cache busts, and the dump for that request reports no diff — not "no change", but no comparison at all.
Direction
Persist the last body per dump key alongside the dumps rather than only in memory, and load it lazily on the first dump for that key after start. The dump directory already holds the bodies; a small sidecar (or reading the most recent prior body for that session key) restores the baseline without changing the wire path.
Worth keeping the in-memory map as the fast path and treating disk as the cold-start fallback, so steady-state dumping does not gain a read per request.
Note the related report on the sibling repo about a requested-but-unread diagnosis header does NOT apply here: this plugin sends x-codex-beta-features: terminal_resize_reflow, which is a feature negotiation rather than a diagnosis channel, and nothing is expected back.
Verified in this repo after ALF routed the equivalent report (cortexkit/anthropic-auth#158) here. Same defect, same cause.
What happens
previousBodiesinpackages/opencode/src/dump.ts:18is a module-levelMap. It is the only baseline the byte-diff has, so it dies with the process. Every dump written by a freshly started plugin carriesdiff: null.Reproduced by dumping two requests in one module instance, then re-importing the module (a restart) and dumping a third:
Why this one matters more than it looks
The diff exists to answer one question: what changed on the wire between consecutive requests. The single most valuable instance of that question in this project has been the first request after a restart, because that is where prompt-cache busts concentrated — it is the reason
openai-auth-sessions.jsonexists at all, persisting Codex thread ids so a restart does not mint a newprompt_cache_key.So the instrument is blind on precisely the request it was built to explain. An operator restarts to test a fix, the cache busts, and the dump for that request reports no diff — not "no change", but no comparison at all.
Direction
Persist the last body per dump key alongside the dumps rather than only in memory, and load it lazily on the first dump for that key after start. The dump directory already holds the bodies; a small sidecar (or reading the most recent prior body for that session key) restores the baseline without changing the wire path.
Worth keeping the in-memory map as the fast path and treating disk as the cold-start fallback, so steady-state dumping does not gain a read per request.
Note the related report on the sibling repo about a requested-but-unread diagnosis header does NOT apply here: this plugin sends
x-codex-beta-features: terminal_resize_reflow, which is a feature negotiation rather than a diagnosis channel, and nothing is expected back.