Skip to content

fix(process): resume buffered NDJSON frames on partial chunks - #8909

Merged
morluto merged 1 commit into
morluto:mainfrom
Afloat16:fix/resume-buffered-ndjson-lines
Nov 6, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
Afloat16:fix/resume-buffered-ndjson-lines

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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.ts and HopperResponseStream.test.ts: 6 passed on Node 24.22.1 / Vitest 5.0.3, with a focused external test configuration.
  • Coverage includes recovery after malformed JSON and a future response ID, buffered delivery before a later response is complete, empty-push draining, and reset.
  • Re-running against the unmodified source: 3 failed, 3 passed.
  • Targeted TypeScript 5.9.3 checking, repository-pinned oxfmt 0.72.0 formatting, and git diff --check passed.

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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T14:03:25.720469Z
We couldn’t complete this review. Comment @codex review to try again.
b8df11f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: apex

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Updates DecodedNdjsonLineBuffer so complete buffered lines can resume on partial or empty pushes.

  • The shared NDJSON reader resumes complete lines after a consumer stops.

Reviews (1) · Last reviewed commit: "fix(process): resume buffered NDJSON fra..." · Reviewed by Greptile

Afloat16 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Both CI and author readiness are now passing on current head b8df11f9aff72c51935bcf86fae1c3e12fb6d741. The regression evidence and validation scope are recorded in the PR description. Could a maintainer review this for merge?

@morluto
morluto merged commit a3621e5 into morluto:main Nov 6, 2026
47 of 49 checks passed
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.

2 participants