Skip to content

fix: pipe stdio in engine.ts to suppress subprocess noise#54

Merged
anandgupta42 merged 4 commits intomainfrom
engine-stdio-piping-tests
Mar 5, 2026
Merged

fix: pipe stdio in engine.ts to suppress subprocess noise#54
anandgupta42 merged 4 commits intomainfrom
engine-stdio-piping-tests

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

Summary

  • Adds { stdio: "pipe" } to all 6 execFileSync calls in engine.ts to prevent subprocess output (tar, uv, pip, python) from leaking into the TUI
  • Adds E2E tests verifying piped stdio suppresses output and a source-level check that all call sites include the option

Test plan

  • E2E tests pass (bun test packages/altimate-code/test/bridge/engine.test.ts)
  • Manual: run altimate-code fresh (no venv) and confirm no raw subprocess output appears in the TUI

🤖 Generated with Claude Code

anandgupta42 and others added 3 commits March 5, 2026 01:20
Verify that all execFileSync calls in engine.ts use { stdio: "pipe" }
to prevent subprocess output (uv, pip install, python --version, etc.)
from leaking into the TUI's text input area.

Tests use real subprocess calls via spawnSync to confirm the piping
behavior end-to-end, plus a source-level check that every call site
in engine.ts includes the stdio option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Without this option, subprocess output from uv, pip install, tar, and
python/uv --version leaks into the TUI's text input area. Piping stdio
suppresses this noise while still capturing the return value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +175 to 178
execFileSync(uv, ["venv", "--python", "3.12", venvDir], { stdio: "pipe" })
} catch (e: any) {
Telemetry.track({
type: "engine_error",

This comment was marked as outdated.

With stdio: "pipe", e.message is a generic "Command failed" string.
The actual diagnostics are in e.stderr, so prefer that for telemetry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@anandgupta42 anandgupta42 merged commit 8071ed2 into main Mar 5, 2026
4 of 5 checks passed
@kulvirgit kulvirgit deleted the engine-stdio-piping-tests branch March 10, 2026 21:06
anandgupta42 added a commit that referenced this pull request Mar 17, 2026
* test: add E2E tests for engine.ts stdio piping

Verify that all execFileSync calls in engine.ts use { stdio: "pipe" }
to prevent subprocess output (uv, pip install, python --version, etc.)
from leaking into the TUI's text input area.

Tests use real subprocess calls via spawnSync to confirm the piping
behavior end-to-end, plus a source-level check that every call site
in engine.ts includes the stdio option.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add stdio: "pipe" to all execFileSync calls in engine.ts

Without this option, subprocess output from uv, pip install, tar, and
python/uv --version leaks into the TUI's text input area. Piping stdio
suppresses this noise while still capturing the return value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: update docs URL to GitHub Pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: include stderr in telemetry error messages for piped execFileSync

With stdio: "pipe", e.message is a generic "Command failed" string.
The actual diagnostics are in e.stderr, so prefer that for telemetry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.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