Repository navigation
Conversation
Exercise SIGTERM, SIGSEGV and SIGKILL with real shell processes, preserving stdout/stderr and requiring a result before the command timeout. These regression tests currently fail because signal exits are ignored by the success-only race.
Treat a failed exitCode effect as a terminal outcome before racing it against timeout and cancellation. Preserve captured output and the termination cause instead of trying to kill an already-exited process. Add a subprocess CLI regression proving that JSON tool output contains the signal and the session can continue. Fixes anomalyco#59925.
|
Flagging for triage: the linked issue #59925 was closed as not planned because v1 only receives critical fixes. This PR only touches |
This branch has not been deployed
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.
Issue for this PR
Closes #59925
Type of change
What does this PR do?
On v1,
kill -TERM $$in the Bash tool waits for the configured timeout and can then reportChildProcess.kill. The spawner failsexitCodeon signal termination, butEffect.raceAllkeeps waiting for a successful result.Convert that failure into a completed race result, report the signal alongside captured output, and include it in the final TUI output metadata. Keep
exit: nullfor signal termination and preserve the existing timeout and abort paths.The issue does not reproduce in v2.2.0. No code was ported from v2.2.0 because its Shell API uses different contracts.
How did you verify your code works?
Linux, Bun 1.4.4; Node 24.15.0 for the full package suite. From
packages/opencode:bun typecheckpassed.bun test --timeout 30000 test/tool/shell.test.ts test/cli/run/run-process.test.ts: 40 passed, including signals, timeout, abort, output capture, and CLI continuation.shell.tsand pass with this fix.bun run test: 3647 passed, 22 skipped, 1 todo, 3 failed. Both worktree timeouts and the file-permissions failure also reproduce with upstreamshell.ts. The permissions test passes withumask 0022instead of the host's0002.bun run script/build.ts --single --skip-install --skip-embed-web-uiand its--versionsmoke passed in a temporary source copy.Windows/macOS and browser e2e were not run locally.
Screenshots / recordings
Manually verified the signal message and shell metadata rendering in the interactive TUI. No screenshot or recording attached.
Checklist