Fix dropped stderr, bind exec server to localhost, repair typecheck - #15
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes found while analyzing the project. All 38 tests pass and the project now type-checks with zero
tscerrors.Bugs fixed
POST/GET /<cmd>returned onlyproc.stdout, so commands that write to stderr (errors, usage text, tools likecurl) produced a blank response in the UI. stdout+stderr are now merged into a single streamingReadableStream, preserving streaming while surfacing errors.Bun.servedefaults to0.0.0.0. Since this server executes arbitrary CLI commands withAccess-Control-Allow-Origin: *, that exposed remote command execution to the LAN. Now binds to127.0.0.1by default (HOSTenv var to override).tsconfig.jsonmissing ambient types — added"types": ["bun"]soBun/process/import.meta.mainglobals resolve; the project now compiles cleanly (was 12+ errors).Other
bun.lockwithpackage.json'stypescript ~6.0.3(lockfile was stale at5.8.2).bun testCI workflow).Test plan
bun test— 38 passbunx tsc --noEmit— 0 errors?version=truereturns the version; unknown route returns 404; server bound to127.0.0.1.🤖 Generated with Claude Code