Repository navigation
Ask for a result: line when a watching session has nothing pending - #1033
Merged
Merged
Conversation
Claude Code's session list groups a session by its reply's closing line and ignores background tasks while it does: `result:` files it under Completed even while `leaf wait` runs, and only the row's word stays Working. The hook asked only for `needs input:`, so a session holding a settled page fell to the classifier and usually read as Working. In replays the wording chose correctly in 18 of 18: `needs input:` for e390c26f's open decisions, `result:` for a merged fix whose page settled, and neither while the agent's own CI watcher was still running. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 23, 2026
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.
Claude Code's session list groups a background session by the closing line of its last reply, and that grouping ignores background tasks. A
result:line files the session under Completed even whileleaf waitruns; only the row's word stays Working, since Claude Code checks for a running task before anything else. The hook from #1026 asked only forneeds input:. A session holding a settled page ended with neither line, and Claude Code's classifier filed it under Working. That is why Leaf sessions waiting on a page sat under Working indefinitely.hooks/wait-started.jsonalso asks forresult: <what you delivered>, but only when nothing waits on the user or on work the agent still has running (the watcher itself aside).host-claude-code.md"Session list" explains both parts: the word Claude Code holds at Working, and how the closing line sets the group, including what happens with neither line.I replayed the closing turn with the new wording, 6 runs per scenario, and every run chose the right ending:
needs input:(6/6)result:(6/6)Two earlier wordings failed the second and third cases.
🤖 Generated with Claude Code