Skip to content

fix(daemon): support chunked IPC responses to avoid pipe truncation#47

Open
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/daemon-ipc-chunking
Open

fix(daemon): support chunked IPC responses to avoid pipe truncation#47
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/daemon-ipc-chunking

Conversation

@haosenwang1018
Copy link

@haosenwang1018 haosenwang1018 commented Mar 11, 2026

Summary

  • fix daemon client IPC response parsing to handle chunked socket data correctly
  • accumulate incoming bytes until newline-delimited JSON frame is complete
  • avoid parsing partial frames (which can silently cut large payloads)
  • make timeout/error handling single-settle safe to avoid duplicate resolve/reject races

Why

Issue #23 reports output truncation at exactly 65536 bytes when piping. The daemon IPC client currently parses each socket data event as if it were a complete JSON response. On large responses, data may arrive in multiple chunks, causing partial-frame parsing and truncated downstream output.

This patch aligns the client with daemon framing (JSON lines) and only parses after a full frame is received.

Closes #23

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.

Output is truncated at 65536 bytes when piped to another process

1 participant