Skip to content

[Bug]: E2E runCli helper hits ERR_CHILD_PROCESS_STDIO_MAXBUFFER on opencli list -f json #1841

@Benjamin-eecs

Description

@Benjamin-eecs

Description

tests/e2e/helpers.ts defines runCli as a promisify(execFile) wrapper over dist/src/main.js. It does not pass an explicit maxBuffer, so it inherits the Node default of 1 MB. On v1.8.2 opencli list -f json emits 1,067,516 bytes (node dist/src/main.js list -f json | wc -c), so the child process overflows the default buffer and execFile rejects with code: 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER'. runCli's catch returns that string as the result code, so the assertion expect(code).toBe(0) fails with the literal string 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' instead of 0. Same root cause on both Linux and macOS in the main E2E Headed Chrome workflow.

Steps to Reproduce

  1. Build main: npm run build
  2. Measure the current list -f json size: node dist/src/main.js list -f json | wc -c returns ~1,067,516 (just past the 1,048,576-byte default maxBuffer).
  3. Run the E2E test: npx vitest run tests/e2e/management.test.ts -t "list shows all registered commands".
  4. Observe failure: AssertionError: expected 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' to be +0.

Same failure trace appears at tests/e2e/output-formats.test.ts for list -f json. yaml / csv / md formats happen to stay under 1 MB so they pass.

Expected Behavior

runCli(['list', '-f', 'json']) returns { code: 0, stdout: <full json> } regardless of manifest size. The helper should not silently truncate / error on large CLI outputs as new adapters land.

OpenCLI Version

1.8.2

Node.js Version

22.x

Operating System

Other

Logs / Screenshots

× tests/e2e/management.test.ts > management commands E2E > list shows all registered commands
   > expected 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' to be +0

× tests/e2e/output-formats.test.ts > output formats E2E > list -f json produces valid output
   > expected 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER' to be +0

(both fail on ubuntu-latest and macos-latest in workflow "E2E Headed Chrome" on sha ec3eddec / chore(release): 1.8.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions