Repository navigation
Conversation
A chat agent's background shells stayed "Running" in the chat's panel after they exited, their timers growing and the chip counting them. Its log says a shell ended only in the stream's task_notification line, which berthd read for helpers and never for shells; and that log holds Claude's lines with "<" escaped, so a notification Claude was told as a prompt didn't match either. Both shapes now end the shell, through one handler for helpers and shells. A running shell also ends when its output file's last line says "[exited with code N]", so it shows within a poll even before a notification. The panel shows "Done · exit 0" or "Failed · exit N" and a duration that stops growing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le never holds up the reader A command whose text reads "exit code 3" no longer reads as exiting 3; a pipe where a shell's output file should be is never opened; and a shell that printed "[exited with code N]" itself and went on runs again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
I can't add the |
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.
Summary
A shell Claude leaves running in the background stayed Running in the chat's "Left running in the background" panel after it exited: its timer kept growing and the chip kept saying "2 shells running". For a chat (structured) agent, its shells never ended at all.
Two causes, both in
internal/transcript:And a fallback that doesn't wait for any notification (a busy agent is told only when its turn ends):
The panel shows the code and freezes the duration:
Jobgainsexit(omitted until known); an older app ignores it.Evidence
Live, on a dev box of this checkout with a structured Claude Code (
verify-berthd→chat-background-shells-live): Claude startssleep 20; echo hiandsleep 6; exit 3in the background.berthd, same scenario): 22 s in, both have exited, both still Running, chip "2 shells running". The scenario fails atFailed · exit 3.Failed · exit 3while the other runs; thenDone · exit 021 s after the start (the shell sleeps 20 s); outputhireadable; durations stay at 20s and 6s over 20 s; the box's own transcript signals saydone exit 0andfailed exit 3; the chip says "2 finished".chat-background-shells):gpu/judge-v2's panel shows Running,Done · exit 0,Failed · exit 3, and the ended durations don't move across a clock tick.Tests (each fails without its half of the fix):
Checks:
go vet ./...andgo test -race ./...pass on the final commit (an earlier run on a loaded box flaked inTestDetach, which fails on main too, and two timing tests that then passed 25/25 and 3/3 alone). App:typecheck:plugins,check:titles,check:type,check:grid,check:csp,check:themes,pnpm test(632 pass),pnpm build,tsc -p e2e; docs build.cargo checknot run (no Rust change; this box lacks the GTK libraries).Codex review and adversarial review: three findings (exit code read from the command text, a FIFO at the output path blocking the reader, a printed marker ending a running shell for good), each fixed with a test above; the re-review found nothing.
verify-berthdgetsfeatures/chat-background-shells.md, its map row, and both scenarios.Merge Danger
Door: two-way
Read-only: it changes how the box reads a conversation and its tasks' output files, and how the app shows them. It writes nothing.
Blast Radius: chat's background panel
The box now reads at most 256 bytes of each still-running shell's output file per conversation read (a regular
.outputfile in atasksfolder only, looked at before it is opened). A shell that prints[exited with code N]itself shows ended until it prints more or its notification comes; Claude Code writes that line on exit.🤖 Generated with Claude Code