[BUG] Team shutdown_request is a no-op: in-process agents never terminate; requestShutdown tool missing

Resolved 💬 2 comments Opened Apr 28, 2026 by QL-4 Closed Apr 28, 2026

What's Wrong?

The shutdown_request / shutdown_response protocol has no system-level effect on in-process agents. Agents correctly receive the message, reply with {type: "shutdown_response", request_id: "...", approve: true}, but never actually terminate. They continue sending idle notifications indefinitely.

TL;DR

When TeamDelete fails with "Cannot cleanup team with N active member(s). Use requestShutdown...", rewrite the team config to remove agents, then call TeamDelete:

  1. Read ~/.claude/teams/{team-name}/config.json
  2. Rewrite the file (use Write, not Edit) keeping only the team-lead in members array
  3. Call TeamDelete() — succeeds since no active members remain

This preserves TeamDelete's cleanup logic (worktrees, task directories), unlike the rm -rf workaround.

Why This Happens

The shutdown_request / shutdown_response protocol has no system-level effect on in-process agents. Agents correctly reply with {type: "shutdown_response", request_id: "...", approve: true}, but never terminate. The requestShutdown tool referenced by TeamDelete's error message does not exist.

Tested Scenarios

| Scenario | Result |
|----------|--------|
| Multiple agents (haiku/sonnet/opus) | ✅ TeamDelete succeeds |
| Agent actively running a task | ✅ TeamDelete succeeds |
| Inbox has message history | ✅ Full cleanup |

Known Limitations

  • In-process agents keep running after TeamDelete. If they send messages afterward, the inbox directory gets recreated. Follow up with rm -rf ~/.claude/teams/{team-name}/ if needed.
  • Agent panel retains stale entries until session restart.

Related Issues

| Issue | Title | Status |
|-------|-------|--------|
| #25371 | TeamDelete fails when teammate exhausted context (earliest report, Feb 2026) | Closed |
| #27882 | Team UI indicators persist after force-deleting team files | Open |
| #37895 | Haiku agents approve shutdown_request but don't terminate | Open (stale) |
| #46284 | Terminated agents persist in UI agent list | Closed (dup of #27882) |
| #47396 | Zombie teammates cannot be force-terminated by team lead | Open |
| #49671 | shutdown_request acknowledged but teammates never terminate | Open |

View original on GitHub ↗

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