Repository navigation
fix(exit): silence virtual exit statuses and allow exit 0 under errexit - #215
Merged
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #213
exit N writes "Command failed with exit code N" to stderr, and exit 0 rejects under set -e
konard
marked this pull request as ready for review
October 7, 2026 04:40
Member
Author
Working session summaryFixed both virtual Validation: 2,574 Bun tests and 830 Rust tests passed. All seven CI workflows pass after one existing macOS timing test passed on rerun. The working tree is clean. This summary was automatically extracted from the AI working session output. |
Member
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (144.1K + 4.4M cached) input tokens, 23.9K output tokens, $1.816148 cost 🤖 Models used:
📎 Log file uploaded as Gist (2516KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Member
Author
🎉 Auto-mergedThis pull request has been automatically merged by hive-mind.
Auto-merged by hive-mind with --auto-merge flag |
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.
Caught virtual
exit 7failures previously populated stderr withCommand failed with exit code 7and mirrored that text to the parent process. Underset('e'), evenexit 0rejected. This change makes both statuses silent and lets successful exits resolve.Fixes #213.
Changes
Reproduction and regression coverage
Before implementation, six of eight tests failed under both runtimes. The nine-case probe showed bogus stderr for caught nonzero exits and rejected status 0 under errexit. After the fix, all observations have empty stderr and
stderr.txtis empty.exit 7rejects under errexit, whileexit 0and argumentlessexitresolve. A real child process provides the silent-status comparison.Tests also verify result/error status aliases, output and exit events, stopping a sequence after
exit 3, default mirroring, disabled mirroring/capture, non-errexit results, and unexpected-handler diagnostics.Validation
bun run check: ESLint, repository formatting, duplication, and TypeScript declarations passed.f9f55a0, including Bun on Linux/macOS/Windows, Node 22/24/26, process-tree checks, security, quality, dependency freshness, executable parity, and benchmark smoke checks: JavaScript checks.The first macOS Node 24 process-tree job observed one extra heartbeat byte (
6 !== 5) in the existingexec: stubborntest atjs/tests/windows-tree-kill.test.mjs:87(preserved run log, line 1806). Its 19 tests passed on a single rerun of the same commit: successful rerun. The initial failure and rerun logs are preserved inci-logs/. The new exit regressions passed in every runtime job on the first attempt.Scope and release
This is JavaScript-specific and carries
parity-exempt: Rust's exit handler already returns the requested code with empty stderr. Executable language parity remains enabled. Existing argument parsing and non-errexit sequence behavior are preserved; full POSIX shell termination semantics are outside this issue's fix.js/.changeset/issue-213-virtual-exit.mdprepares the next patch release. Package versions remain managed by the release workflow.Changes
.github/workflows/js.ymlexperiments/issue-213/README.mdexperiments/issue-213/virtual-exit.mjsjs/.changeset/issue-213-virtual-exit.mdjs/src/$.mjsjs/src/commands/$.exit.mjsjs/tests/virtual-exit.test.mjs