Your helper agent was refused at midnight; the parent chat waited until you got back

It is 11pm. You hand a messy job to a background subagent — run the tests, fix the report, summarise what it found — and close the terminal.
A minute past midnight the model’s safety filter refuses the request: “This content was flagged for possible cybersecurity risk.” The parent chat hears nothing. No error, no notice, no next turn. Your plan sits exactly where it was, and it is still sitting there when you come back the next morning, having waited 48 minutes.
Worse, when you do look, the reason is not even the real one: the parent received status=error: '<parent session id>' — a session ID in the place where a failure reason belongs.
Two bugs stacked on top of each other
This took two independent defects. Either one alone would have been survivable.
One: the real refusal was replaced by a KeyError. The child inherits the parent turn’s print sink (tools/delegate_tool.py copies _print_fn). Once the parent’s live session had been retired, SessionAuthority.publish_execution indexed self.sessions[session_id] before its generation fence. The child’s next status print therefore raised KeyError('<parent session id>'), which killed the child. The parent got that session ID as its failure reason instead of content_policy_blocked.
Two: the failure never woke the parent. With no viewer attached, a child’s completion is written into the session history as a note, and the admission settles without a model call. For “a result you can read later”, that is the right call — it saves a model call and stops an agent from talking to itself at 3am. For “a failed child that the parent is waiting on”, it is exactly wrong: the parent should get a turn to retry on another model, or to tell you it was refused.
The fix: knock on the door, at most three times
Two changes, one per bug.
publish_execution on a retired session returns False instead of raising. That is already the answer the generation fence gives a late callback from a sink that outlived its claim; now the index is guarded too. The child keeps running, its failure carries the classified failure_reason, and the exception itself is logged with a traceback.
A failed delegation result runs as the parent’s turn even with no viewer. The decision lives in delegation_wakes_parent() (tools/process_registry_notifications.py):
def delegation_wakes_parent(evt: dict) -> bool:
"""True for an async delegation's FINAL result with a failed child (any status other than done or a
requested stop). Its unviewed local parent runs it as a turn rather than a note ..."""
if evt.get("type") != "async_delegation" or evt.get("task_failure_notice"):
return False
if evt.get("_sibling_failed"):
return True
if evt.get("role") == "cron_run":
return False
...
return any(
(r.get("status") or ("failed" if r.get("error") else "completed")) not in (*_DONE, *stopped)
for r in results)
A few details carry weight:
- Only the final result counts (
type == "async_delegation", not the earlytask_failure_notice). The per-task diagnostic notice never wakes anything, so a batch does not keep interrupting its parent. - A requested stop —
interrupted,cancelled— is not a failure. If you or the user stopped it, the parent has nothing to recover. - In a coalesced batch, a failed sibling wakes the parent just as a failed primary does (
_sibling_failed); otherwise one small task dying leaves the parent waiting. - The
cron_runrole is excluded: a manually triggered cron run produces finished text, handled as a note like a scheduled one.
The third piece is a brake. A woken parent that immediately re-dispatches into the same failure (billing, a usage limit) would wake itself forever, so gateway/session_completion_notes.py sets:
UNATTENDED_WAKE_LIMIT = 3
Past three wakes the failure becomes a note again, until a viewer attaches or the user sends something (which resets the counter). There is one more boundary: no wake in a chat its viewer already closed (exit or /new, via refused_for_session), because a re-dispatch there would be refused the background and end up running inside the wake turn.
What changes in practice
| Situation | Before | Now |
|---|---|---|
| Background subagent succeeds, nobody watching | Silent note, read on your next message | Unchanged |
| Background subagent fails (refusal, timeout, error), nobody watching | Silent note, parent says nothing | Parent runs a turn: retry or report the reason |
| You are watching | Normal turn | Unchanged |
You already /new-ed or exited that chat |
— | No wake (the work would land in the wrong conversation) |
| Same failure repeating | — | At most three wakes, then a note |
The practical result: a job that broke overnight now leaves you a turn saying “it tried, it failed, here is why, and I already retried on another model” instead of a silent dead end.
The pattern behind this bug
Worth stating separately, because it is not specific to subagents: failure paths in async workflows lose information far more easily than success paths. Success is read by someone, so a bug there gets noticed immediately. Failure is unread, so the bug hides — until the one day you happen to be waiting on that exact result.
Three questions to ask of your own automation:
- Does a background failure have an explicit recipient, or only a place where it gets written for later?
- Can the failure reason be overwritten by a side-effect exception on the way out? (Here a
KeyErrorreplacedcontent_policy_blocked.) - Does auto-recovery have a cap? Unlimited self-healing turns into a billing incident during a persistent outage.
Status and what to do meanwhile
PR #149568 merged on 2026-11-10 at 15:48 UTC; the v0.23.1 tag stops at a commit from 11-10 00:24 UTC. So the fix is on main only — source installs tracking main have it, v0.23.1 and older do not.
Update (2026-11-17): these changes shipped in v0.23.2 (November 16) —
hermes updatebrings them in. The “not in v0.23.1” wording above is a snapshot from publication time.
Until the next release, the practical mitigation is: do not leave a critical delegation fully unattended. Either make the wait explicit (a small cron job that comes back and asks a few minutes later), or instruct the subagent in its prompt that it must always answer with one line even on failure — turn silence into text.
To go deeper into this layer: live subagent orchestration covers the delegate_task list/steer/stop control surface, error handling and recovery explains Hermes’ error classification and retry ladder, and unattended approvals covers the other common “nobody is here” stall.