Skip to content

fix(deploy): bound captured command output - #85

Open
andrewkcchung wants to merge 1 commit into
mainfrom
upstream/u19-command-output-capacity
Open

andrewkcchung wants to merge 1 commit into
mainfrom
upstream/u19-command-output-capacity

Conversation

@andrewkcchung

@andrewkcchung andrewkcchung commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Why

Deployment and rendering tools can legitimately emit more output than Node's default synchronous-process buffer, causing otherwise successful operations to fail with ENOBUFS. A named, finite platform bound makes these commands reliable while keeping memory use explicit and preventing callers from selecting an unbounded capture size.

What changed

  • Define a named 64 MiB maximum for each captured output stream.
  • Apply the bound to the shared deployment command runner.
  • Reject invalid or unbounded caller overrides.
  • Add a regression that produces output above Node's default buffer and proves the shared runner captures it successfully.

Behavioral proof

Command:

node --test deploy/scripts/test/common.test.mjs
  • Red — test-only patch on main: The large-output regression failed with ENOBUFS under the previous default-buffer behavior.
  • Green — this branch: 21 tests passed, including the large-output and unbounded-value regressions.

Risk assessment

Relative risk: Low

The change adjusts one shared deployment command-runner resource bound without changing command construction or execution semantics. Memory remains explicitly capped at 64 MiB per stream. Tests reproduce the prior ENOBUFS failure and reject invalid or unbounded overrides; peak memory when both streams fill is the main review concern.

Review focus

  • Confirm 64 MiB per stream is a reasonable finite ceiling for deployment render/build output.
  • Consider peak memory when both stdout and stderr approach the limit concurrently.
  • Confirm invalid overrides fail explicitly instead of silently reverting to an unsafe or unbounded value.
  • Confirm existing argument redaction and environment-file parsing behavior remains unchanged.

Raise the synchronous command runner capacity above Node's default while retaining a finite ceiling and covering ENOBUFS through public behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant