SubagentHandback enforcement keeps prompting the subagent after its parent has exited (retry loop)

Status Open
Reported on v2.1.284
Maintainer reply None cached
Activity 0 comments · opened Sep 29, 2026

Summary

A background subagent's parent exits before the subagent finishes. The subagent calls SubagentHandback, which returns:

{"success":false,"message":"Nothing was sent: the agent that spawned you is no longer running."}

The harness still keeps reminding the subagent to deliver its report through SubagentHandback. The subagent retried three times, and each retry failed with the same message. The subagent has no way to satisfy the check, so it spends turns until it gives up.

Expected

Once SubagentHandback returns "no longer running", the enforcement stops. The subagent's final text goes to the session (for example as an <agent-message>), or the subagent ends cleanly.

Actual

The enforcement reminder keeps coming after each failed handback. The subagent loops through failed SubagentHandback calls (3 observed) before it stops.

Environment

  • Claude Code 2.1.284
  • macOS (Darwin 24.6.0)
  • Permission mode: auto
  • Several background subagents spawned in parallel with the Agent tool

Related

  • #96225: the same error while the parent is still alive
  • #96849: a second SubagentHandback after resume is rejected

View original on GitHub ↗