Skip to content

fix(claude): a background Bash keeps the session in Implementing - #283

Merged
bk-agent-01 merged 4 commits into
stagefrom
t3code/claude-background-shell-is-work
Oct 8, 2026
Merged

bk-agent-01 merged 4 commits into
stagefrom
t3code/claude-background-shell-is-work

Conversation

@bk-agent-01

Copy link
Copy Markdown
Collaborator

Problem

A Claude session that waits on a run_in_background Bash shows under Ready with no badge. Example: "Start Sessions from Today's To-Do" waited on "Wait for the Automations deploy run to finish". The Claude adapter names that task command. The upstream rule (backgroundWorkHoldsCompletion, pingdotgg#2829) does not hold for command, because it assumes a dev server that the agent left running. But the Claude CLI starts the model again when a background Bash ends, so the agent is not done.

Fix

  • Contract: the command roster task gets an optional wakesAgent field. This is additive, so old rosters still decode.
  • The Claude adapter sets wakesAgent: true on background Bash tasks. This is a two-line wrapper with a marker.
  • backgroundWorkHoldsCompletion holds for a command when wakesAgent is true.

Result: the row goes to Implementing with the "Monitoring" badge, the same as for a Monitor call. Auto-settle and the "done" alert also wait until the shell ends. Codex commands and other providers do not change.

Trade-off: if a Claude agent starts a dev server in the background and leaves it, the row stays in Implementing until the server stops.

Evidence

  • New fork test: orchestrationV2PendingBackgroundWork.expbkt3.test.ts.
  • Two Claude roster tests now expect wakesAgent: true.
  • CI runs the tests. The dev server does not run them.

🤖 Generated with Claude Code

bk-agent-01 and others added 2 commits October 7, 2026 13:21
Claude re-invokes the model when a run_in_background Bash ends, but the
roster named it a plain `command`, which upstream treats as a dev server
left running. The session then looked finished (Ready, no badge) while the
agent was still waiting. Mark Claude background commands `wakesAgent`, and
let such a command hold completion like a monitor. Codex commands do not
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 7, 2026
bk-agent-01 and others added 2 commits October 7, 2026 15:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bk-agent-01
bk-agent-01 merged commit 98c277b into stage Oct 8, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant