Repository navigation
fix(claude): a teammate that approved its shutdown is no longer counted as running - #744
Closed
Haeminway1 wants to merge 1 commit into
Closed
Haeminway1 wants to merge 1 commit into
Haeminway1 wants to merge 1 commit into
Conversation
…ed as running An agent-team teammate ends by answering its lead's shutdown_request with SendMessage(shutdown_response, approve: true); Claude Code's tool result says "Shutdown approved … is now exiting" and nothing follows. turnAfter took only an end_turn answer as the end, and the shutdown request after it reset that, so every shut-down teammate read as running forever: a live pane showed 12 background tasks with 1 background shell and no subagent alive. That approved answer now ends the agent's turn; any later message still resumes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
Owner
|
Thank you for this fix, @Haeminway1! It has been carried into #764 (#764) together with other Claude parsing fixes in the same area, because it conflicted with main after the 0.4.6 release. Your commit is cherry-picked with you as its author, and the changelog entry links this PR and credits you. I'm leaving this PR open so the maintainer can close it when #764 lands. |
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
…swer Hermes, end shut-down teammates (#764) ## Change Fixes four things reported against 0.4.6, all in the prompt reader and the Claude background-task reader. - **Claude multiple choice with ticked rows (#752).** Claude Code 2.1.296 draws a ticked row as `[✔]`; the reader only took `[✓]`, so once a row was ticked the card became a single choice, its labels kept the box, and a pick sent Enter on a multi-select row, which unticks it. `[✔]` is now a tick. With the cursor on the unnumbered **Submit** row the card no longer disappears: the moves count Submit as a row between "Type something" and "Chat about this", so ↑/↓ + Enter + → still land where they should. - **`/model` guard (#542).** `claudeModelListWaits()` read the hint over six lines joined with spaces, so a hint cut inside a word (`ses` / `sion`) or wrapped over seven lines was missed and pending delivery could type Enter into the list. The hint is now read with spaces taken out over up to sixteen lines, and the run of lines that holds it must begin with it, so the same words quoted in Claude's output (`⏺ Example: Enter to set as default …`) no longer hold pending sends. `parseClaudeModel` and `promptTailIsActive` read the hint the same way, so the card and the guard agree. - **Agent-team teammates that shut down (carried from #744 by @Haeminway1).** A teammate that approved its lead's shutdown request is read as completed at that answer, so the pane's running count stops counting it. Cherry-picked with its author kept. - **Hermes clarify questions (carried from #750 by @DarkoKuzmanovic).** Hermes's clarify dialog gets an answer card: arrows + Enter for a choice, Space ticks + Enter for a multiple choice, typed text for "Other" and open questions. No digits are sent, per server/AGENTS.md. Cherry-picked with its author kept, plus one review fix (53ae368): text already on the dialog's `>` line (typed in the terminal, or a typed answer Tab brought back) used to join the chat's answer, so the line is emptied first with ctrl+k / ctrl+u, which Hermes's TextInput takes on every platform (`ui-tui/src/lib/platform.ts`). An unused `currentPrompt` export is dropped. Fixes #752 Fixes #542 Carries #744 and #750 Not changed: #542's gap 4 (a line under the hint that is not Claude's footer). The issue says no real layout is known to draw one, so it is left for a maintainer decision. ## Verification - Before the fix (53ae368), the six new tests failed as the issues describe: the three `Claude's multiple choice ticked in the terminal` tests (no card, single choice, Submit move missing) and the three `Claude Code's model list under a hint wrapped anywhere` tests (split word, seven lines, quoted hint). They pass after 999099b. - `HERDR_TEST_MODE=unit bun test ./server/prompt.test.ts ./server/hermes-prompt.test.ts ./server/claude-subagents.test.ts`: 311 pass, 0 fail. - `bun run typecheck`: passes. - `CHECK_MAX_RUNS=8 bun run check full` on ba61fd4 (after merging origin/main 5792d71): workflow syntax, generated types, typecheck, build, unit tests and the integration and browser lanes all `ok` (252 browser PASS, 0 FAIL). Origin/main was merged in, not rebased (5792d71, #755); the only conflict was CHANGELOG.md. --------- Co-authored-by: Haeminway1 <130830910+Haeminway1@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Darko Kuzmanovic <darko.kuzmanovic@gmail.com>
Owner
|
Thank you, @Haeminway1! Your change landed on main through #764, with you kept as the commit author and credited in the changelog. Closing this one as superseded by #764. |
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.
Change
A Claude pane whose session used an agent team kept every teammate counted as running after it shut down. A live pane showed
background_tasks: 12with no subagent alive. The twelfth was a real background shell, which Claude Code's own footer also showed (1 shell still running).A teammate ends by answering its lead's
shutdown_request. It callsSendMessage({type: "shutdown_response", approve: true, request_id: "shutdown-…"}), and Claude Code's tool result saysShutdown approved. … is now exiting.Nothing is written after that.turnAftercounted only anend_turnanswer as the end of a turn. The shutdown request that arrives after the teammate's lastend_turnreset that, so every teammate that shut down read as running forever. All 11 teammates in the reported session ended this way.The answer approving a shutdown now ends the agent's turn. It is matched as a
toolUseResultwithsuccess: true, arequest_idstarting withshutdown-, and a message starting withShutdown approved. A rejected request still counts as running. A later message to the agent still resumes it.Validation
server/claude-subagents.test.tscovers an approved shutdown afterend_turn(completed, ended at the answer), a rejected request (running), and a message after the approval (running again). Result: 73 pass.claudeSubagentson the reported session's real files: 12 running before the fix (11 teammates and the shell), 1 running after (the shell).typecheckandserver/claude-session.contract.test.tspass.test:unitpasses exceptvoice transcribe > streams deltas…, which fails the same way onmain.🤖 Generated with Claude Code