Repository navigation
Fork: a background Bash counts as running work until it ends - #16
Merged
Merged
Conversation
Claude Code's background commands (a Bash with run_in_background, or one moved to the background when its timeout ran out) now hold the agent's turn like a background agent does: crates/core/src/agents/helpers.rs counts one from the result that names it (toolUseResult.backgroundTaskId, or the words the result starts with) until its <task-notification> (completed, failed or killed) or TaskStop's result, which is all a stop writes. Before, only "Async agent launched" counted, so the check, the review and the ready alert started while the command still ran, on what the agent said before it ended. The shapes are taken from real transcripts (Claude Code 2.1.308 to 2.1.322). Tests: tests/helpers/shells.rs (failed on main: the task reached approval with the check and the review run while the command ran). Docs: how-work-gets-done and troubleshooting. Ported from upstream Shepherdr 54a65b23 (SHEP-148, #865), rewritten in Rust. MIT, same notice as this fork's LICENSE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fork-a-background-bash-counts-
Review fix: a foreground Bash whose own output began with "Command running in background with ID: ..." was read as a background start that no notification would ever end, holding a finished task at Finishing. Claude Code's result names a background command in toolUseResult.backgroundTaskId (every one recorded, 2.1.308 to 2.1.322), so that alone counts now; the words of a result never do. tests/helpers/shells.rs has the reviewer's case. Upstream Shepherdr 54a65b23 (SHEP-148, #865). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jbutton
marked this pull request as ready for review
November 13, 2026 06:22
Brings in the CI fix (#17) so the pull request's checks run on a base that passes on GitHub. Co-Authored-By: Claude Opus 5.5 <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.
Nothing is still running in the background: the full check ended and passed, I started no servers, and no test processes from this worktree are left. Everything is committed, and the closing note is written.
Task: PRJ-11 (herdr-projects/11)