fix: retain timed-out bash commands and clean up shells on runtime exit - #317
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bub | 2f6f19a | Commit Preview URL Branch Preview URL |
Sep 21 2026, 01:58 AM |
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.
Foreground bash commands that exceed
timeout_secondsnow continue in the background and return ashell_id, instead of being terminated. Output remains available throughbash.output, andbash.killcan stop the command. Explicit background responses also include the shell ID and follow-up actions.Shell ownership now follows the runtime lifecycle:
provide_lifespanhook enters plugin resource generators withinframework.running(). The builtin implementation owns shells across turns and cleans them up on normal exit, exceptions, cancellation, and startup failure.Tests cover continued output after timeout, explicit termination, session and runtime cleanup, scope isolation, spawn/shutdown races, repeated cancellation, and descendant termination. English and Chinese hook documentation describe the lifecycle and its limits.
Limits: cleanup covers the POSIX process group. Descendants that deliberately leave it and abrupt
SIGKILLof Bub require OS-level supervision. Windows currently terminates only the direct shell process. SDK callers need to run the builtin lifecycle withinframework.running()(or explicitly manage their ShellManager lifespan).Validation:
git diff --checkpassed.