diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-20 20:42:14 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-20 20:42:14 +0300 |
| commit | f7b26a911772dab16a49d982002d2bbe58e0956b (patch) | |
| tree | 78a24e14adb7cdd5e99b99c6688c84d416e8c5ef /src/integration/assets | |
| parent | 05e44d003962cee6be4e289ac16038a72441ce7e (diff) | |
fix: stop claude subagent completion reviving working
refs #198
Diffstat (limited to 'src/integration/assets')
| -rw-r--r-- | src/integration/assets/claude/herdr-agent-state.sh | 11 |
1 files changed, 9 insertions, 2 deletions
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() |
