Repository navigation
fix(process): resume buffered NDJSON frames on partial chunks - #8909
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryUpdates
Reviews (1) · Last reviewed commit: "fix(process): resume buffered NDJSON fra..." · Reviewed by Greptile |
|
Both CI and author readiness are now passing on current head |
Problem
When a response consumer stops iteration, complete lines remain buffered. A subsequent chunk without a newline returns early even though an older complete response is ready. Hopper's recovery path can therefore delay a buffered reply until an unrelated later response supplies another newline.
Changes
Track the next buffered newline before yielding a line. Resume delivery when complete buffered lines exist, including on a partial or empty push, and clear that state on reset. Incomplete fragments still accumulate without rescanning or joining them on every push.
The shared decoded NDJSON splitter remains the owner of framing; Hopper retains its response validation and abort policy. The Ghidra consumer continues to drain all available lines.
Validation
DecodedNdjsonLineBuffer.test.tsandHopperResponseStream.test.ts: 6 passed on Node 24.22.1 / Vitest 5.0.3, with a focused external test configuration.git diff --checkpassed.These are parser and production-response-stream tests. The full project checks and a live Hopper/Ghidra session were not run.
Author readiness
Human owner: @Afloat16