Repository navigation
fix(clients): show a background command's ending in the turn it wakes - #601
Merged
Merged
Conversation
incognitojam
added a commit
that referenced
this pull request
Oct 1, 2026
When a background command or monitor finishes while the agent is idle, Claude hands the result back and the agent starts a new turn with no user message. The ending only showed as a status on the launch row in the earlier turn, so the woken turn gave no sign of why it started. A completed or failed ending now also shows as its own row, with the same status mark as the launch row, in the turn where the agent learns about it: the later turn it arrived during, or the next turn after an idle ending. The launch row keeps the outcome. Endings in their launch turn, stopped endings, and idle endings no turn has followed add no row, so a session-end stop still cannot hide a compaction divider.
…hat starts its turn An ending that arrived while the agent was idle kept its own timestamp when it moved into the next turn. When the user started that turn, the ending sorted before their message, so the turn's "Worked for" fold appeared above the message that started it. The ending now takes the receiving turn's first activity time and sorts with that turn's work.
incognitojam
force-pushed
the
styal/woken-turn-exit-row
branch
from
October 1, 2026 18:54
ac3582b to
539d060
Compare
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.
Note
When a background command or monitor finishes while the agent is idle and wakes it, the woken turn now shows that ending inside its "Worked for…" fold, e.g. "Watch release checks ✓". The launch row in the earlier turn keeps the outcome as before.
What Changed
stoppedendings (killed by the agent, the user, or a session ending), or idle endings no turn has followed yet. That keeps fix(web,mobile): show background task endings on the call that started them #535's guarantee that a session-end stop cannot fold away a/compactdivider.@t3tools/client-runtime/work-log/background-exit, used by both web and mobile. Thebackground-task-endingsledger entry is updated to match.Why
Claude Code wakes the agent when a background command or monitor finishes. The woken turn starts without a user message, and until now its fold contained only what the agent did next, with nothing showing why the turn started. The ending was visible only as a status on the launch row, which may be far up the thread.
A read-only scan of one maintainer's local database:
Notes
resumesProviderflag could replace the "next turn" lookup.UI Changes
A synthetic Claude thread: a background watcher launched in the first turn finishes while the agent is idle, and the agent wakes into the second turn. The second turn's fold is expanded in both images.
Validation
Written by an agent (Claude Code, claude-opus-5-5).