[Bug] Worker recovery can leave NUL-prefixed JSONL records that session loading silently drops #1866
sankks11
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Affected area
Session persistence and daemon worker recovery in
packages/coding-agent.What happened
A byte-level audit of 25 top-level session journals found eight malformed records across seven journals. Seven decoded to
prime-agent.worker_recoveryrecords and one decoded to asession_staterecord after removing only the leading NUL bytes.The prefix distribution was:
After that prefix, each line was otherwise valid UTF-8 JSON. The prefix widths also matched nearby persisted-line widths, which makes a rewrite/append offset race plausible, but I do not yet have a deterministic writer reproduction and am not claiming that mechanism as proven.
Current loading in
appendEntryFromBuffer()catches parse failures and skips these rows without a diagnostic. That can hide a recovery disclosure or session-state transition from replay. Strict JSONL readers fail on the same data.Artifact-level check
This detects the observed shape without printing journal contents:
I have not attached the affected journals because they contain private session data.
Expected behavior
Environment
The latest observed artifact was on Linux with Node.js 24. The currently installed CLI reports
0.8.1, but the journals do not persist enough application-version provenance to bind every historical write to an exact release.All reactions