Skip to content

Fix dropped stderr, bind exec server to localhost, repair typecheck - #15

Merged
PIsberg merged 1 commit into
mainfrom
fix/stderr-and-localhost-binding
Jun 18, 2026
Merged

Fix dropped stderr, bind exec server to localhost, repair typecheck#15
PIsberg merged 1 commit into
mainfrom
fix/stderr-and-localhost-binding

Conversation

@PIsberg

@PIsberg PIsberg commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Three fixes found while analyzing the project. All 38 tests pass and the project now type-checks with zero tsc errors.

Bugs fixed

  • Dropped stderr on the exec endpointPOST/GET /<cmd> returned only proc.stdout, so commands that write to stderr (errors, usage text, tools like curl) produced a blank response in the UI. stdout+stderr are now merged into a single streaming ReadableStream, preserving streaming while surfacing errors.
  • Exec server bound to all interfacesBun.serve defaults to 0.0.0.0. Since this server executes arbitrary CLI commands with Access-Control-Allow-Origin: *, that exposed remote command execution to the LAN. Now binds to 127.0.0.1 by default (HOST env var to override).
  • tsconfig.json missing ambient types — added "types": ["bun"] so Bun/process/import.meta.main globals resolve; the project now compiles cleanly (was 12+ errors).

Other

  • Reconciled bun.lock with package.json's typescript ~6.0.3 (lockfile was stale at 5.8.2).
  • Added an integration test asserting the exec endpoint surfaces stderr output (locks in fix Perf improvements #1; runs in the existing bun test CI workflow).

Test plan

  • bun test — 38 pass
  • bunx tsc --noEmit — 0 errors
  • Manual smoke: invalid flag now returns the diagnostic (previously empty); ?version=true returns the version; unknown route returns 404; server bound to 127.0.0.1.

🤖 Generated with Claude Code

- Exec endpoint merged stdout+stderr so error output is visible (was stdout-only)
- Bind Bun.serve to 127.0.0.1 by default (HOST overridable); avoids exposing
  arbitrary command execution to the LAN
- Add "types": ["bun"] to tsconfig so the project typechecks (0 tsc errors)
- Reconcile bun.lock with package.json typescript ~6.0.3
- Add integration test asserting the exec endpoint surfaces stderr

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PIsberg
PIsberg merged commit 51eb73d into main Jun 18, 2026
4 checks passed
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