From f7b26a911772dab16a49d982002d2bbe58e0956b Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Wed, 20 May 2026 20:42:14 +0300 Subject: fix: stop claude subagent completion reviving working refs #198 --- src/integration/assets/claude/herdr-agent-state.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/integration/assets') diff --git a/src/integration/assets/claude/herdr-agent-state.sh b/src/integration/assets/claude/herdr-agent-state.sh index 035c3fe0..5042cad8 100644 --- a/src/integration/assets/claude/herdr-agent-state.sh +++ b/src/integration/assets/claude/herdr-agent-state.sh @@ -2,7 +2,7 @@ # installed by herdr # safe to edit. this hook only activates inside herdr-managed panes. # HERDR_INTEGRATION_ID=claude -# HERDR_INTEGRATION_VERSION=2 +# HERDR_INTEGRATION_VERSION=3 set -eu @@ -47,9 +47,16 @@ if hook_input_file: except Exception: hook_input = {} +hook_event_name = str(hook_input.get("hook_event_name") or "") is_subagent = bool(hook_input.get("agent_id")) +if hook_event_name == "SubagentStop": + # SubagentStop is a completion event. Older Herdr integrations mapped it + # to durable working, but Claude recap/away-summary can emit it after the + # main turn has already stopped. Never let it revive an idle pane. + raise SystemExit(0) if is_subagent and action in ("idle", "release"): - action = "working" + # Subagent completion must not make the parent pane look done early. + raise SystemExit(0) request_id = f"{source}:{int(time.time() * 1000)}:{random.randrange(1_000_000):06d}" report_seq = time.time_ns() -- cgit v1.2.3