Team agents that idle without completing work ignore shutdown_request messages

Resolved 💬 4 comments Opened Mar 1, 2026 by kavanaghpatrick Closed Mar 1, 2026

Summary

Team agents spawned via TeamCreate + Agent that go idle without completing their assigned task become zombie agents — they do not respond to shutdown_request messages. The only way to clean them up is manually deleting the team directory (rm -rf ~/.claude/teams/<name>/).

Steps to Reproduce

  1. Create a team via TeamCreate
  2. Spawn multiple agents via Agent tool with team_name parameter
  3. Some agents complete their work and send results via SendMessage — these agents shut down normally when sent shutdown_request
  4. Other agents go idle without completing their task or sending any message back (they just stop working)
  5. Send shutdown_request to the idle/zombie agents
  6. Expected: Agent receives shutdown request, calls shutdown_response with approve: true, and terminates
  7. Actual: Agent wakes up briefly (processes the message), then immediately goes idle again. The shutdown_request is never acknowledged. This repeats indefinitely.

Observed Behavior

In my session, I spawned 3 rounds of team agents (12 total) for a validation task:

Round 1 (4 agents: validator-divergence, validator-overcompute, validator-simd-btree, validator-hetero-json-meta):

  • All 4 went idle without returning any results
  • All 4 ignored multiple shutdown_request messages

Round 2 (4 agents: validate-exp48-divergence, validate-exp49-overcompute, validate-exp50-51, validate-exp52-55-meta):

  • All 4 went idle without returning any results
  • All 4 ignored multiple shutdown_request messages

Round 3 (4 agents: v1-divergence, v2-overcompute, v3-simd-btree, v4-hetero-json-meta):

  • All 4 completed their work and sent detailed results via SendMessage
  • All 4 responded to shutdown_request correctly and terminated

The pattern is clear: agents that successfully complete work shut down fine; agents that idle without completing work become zombies.

Shutdown Attempt Log

For each zombie agent, I sent 2-3 shutdown_request messages. Each time:

→ SendMessage(type: "shutdown_request", recipient: "validator-divergence", content: "Please approve this shutdown request immediately.")
← success: true, request_id: "shutdown-xxx@validator-divergence"
← (seconds later) idle_notification from validator-divergence

The agent wakes up from idle, but instead of calling shutdown_response, it just goes idle again. The request_id is never referenced in a response.

Workaround

Had to manually delete the team:

rm -rf ~/.claude/teams/gpumaxx-validation ~/.claude/tasks/gpumaxx-validation

TeamDelete also failed because it reported "Cannot cleanup team with 8 active member(s)" — the zombie agents counted as active even though they weren't doing anything.

Impact

  • Cost: Zombie agents consume resources (they wake up for each shutdown attempt, process a turn, then idle again)
  • Cleanup: TeamDelete is blocked, requiring manual filesystem cleanup
  • UX: The team lead has no way to forcefully terminate unresponsive agents
  • Scaling: In a 12-agent team, 8/12 became zombies — this makes teams unreliable for multi-agent workflows

Suggested Fixes

  1. Force shutdown: Add a force: true parameter to shutdown_request that terminates the agent without requiring approval
  2. TeamDelete --force: Allow TeamDelete to force-terminate all agents regardless of state
  3. Idle timeout: Auto-terminate agents that have been idle for N minutes without any pending work
  4. Root cause: Investigate why agents that idle without completing work fail to process shutdown_request messages — they may be in a state where the shutdown request JSON isn't being parsed/handled by the agent's conversation context

Environment

  • Claude Code version: latest (2026-03-01)
  • Model: claude-opus-4-6
  • Platform: macOS ARM64 (Darwin 24.6.0)
  • Team framework: TeamCreate / Agent / SendMessage

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗