Skip to content

fix(scan): allow large git output during scan prep - #572

Open
sylvesterkaczmarek wants to merge 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/large-repository-git-output
Open

fix(scan): allow large git output during scan prep#572
sylvesterkaczmarek wants to merge 3 commits into
openai:mainfrom
sylvesterkaczmarek:fix/large-repository-git-output

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary

Allow committed-diff scan preparation to handle repositories whose tracked-file inventory exceeds Node's default execFile stdout buffer.

validateCommittedDiffCheckout() runs git ls-files -t -z to detect sparse checkouts. On large repositories, that output can exceed Node's default 1 MiB buffer and terminate scan preparation with ERR_CHILD_PROCESS_STDIO_MAXBUFFER before scanning begins.

Fixes #565.

Changes

  • remove Node's implicit 1 MiB stdout ceiling from the shared trusted Git execution path with maxBuffer: Infinity, matching the unbounded subprocess-buffer convention already used elsewhere in this package
  • add an end-to-end regression that creates a synthetic clean Git repository whose tracked-file listing is confirmed to exceed 1 MiB
  • exercise normal committed-diff target normalization and checkout validation against that repository
  • keep Git invocation, sparse-checkout detection, target validation, and parsing semantics unchanged

Testing

  • added a focused synthetic-repository regression that produces more than 1 MiB of real git ls-files -t -z output and verifies committed-diff validation completes
  • reviewed the branch against current upstream main; the diff is limited to one production line in src/targets.ts and the regression file
  • fork workflow execution did not produce a completed verification result in this environment, so pushed-head CI remains the authoritative full typecheck, formatting, build, and test validation

Risk and rollout

Low. Git command output was already collected in memory; this removes Node's default rejection threshold rather than changing the command, output format, or validation behavior. The change follows the same maxBuffer: Infinity convention already present in the SDK runtime and avoids introducing an arbitrary repository-size limit.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@github-actions github-actions Bot added the bug Something isn't working label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scan prep crashes with "stdout maxBuffer length exceeded" on large repositories (0.1.11+)

1 participant