[BUG] Teammate ignores shutdown_request and loops idle notifications indefinitely (in-process backend)

Resolved 💬 4 comments Opened Mar 6, 2026 by parthpm Closed Apr 18, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When a team lead sends a shutdown_request via SendMessage to an idle teammate (in-process backend), the teammate occasionally does not process it. Instead, it continues emitting idle_notification messages indefinitely. Follow-up shutdown_request messages and direct SendMessage messages are also ignored.

In a 5-teammate team, 4 out of 5 shut down correctly on the first shutdown_request. The 5th teammate (identical configuration) entered an infinite idle loop and never processed any subsequent messages.

The stuck teammate had successfully completed its assigned task, sent results back to the team lead, and was idle when the shutdown was requested. Message delivery worked correctly during the teammate's active working phase — only post-idle messages were ignored.

What Should Happen?

The teammate should receive the shutdown_request, call SendMessage with type: "shutdown_response" and approve: true, and terminate — the same as the other 4 identically configured teammates did.

Error Messages/Logs

No error messages. The teammate simply emits idle_notification JSON every ~30-60 seconds: {"type":"idle_notification","from":"lean-editor","timestamp":"...","idleReason":"available"}

  Timeline:
  - Teammate completes task, sends results, goes idle
  - Team lead sends shutdown_request → teammate emits idle_notification (ignores shutdown)
  - Team lead sends second shutdown_request → same result
  - Team lead sends direct message → same result
  - Teammate continues idle_notification loop indefinitely

Steps to Reproduce

  1. Create a team: TeamCreate with a team name
  2. Spawn 5 teammates via Agent tool, all with:
  • subagent_type: "general-purpose"
  • run_in_background: true
  • team_name set to the team
  1. Assign tasks to all teammates via TaskCreate + TaskUpdate
  2. Wait for all teammates to complete their tasks and go idle
  3. Send shutdown_request to all 5 teammates via SendMessage
  4. Observe: 4 teammates shut down within 3-5 seconds. 1 teammate ignores the shutdown and loops idle_notification

indefinitely.

  1. Sending additional shutdown_request or direct messages to the stuck teammate has no effect.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.70

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

  • All 5 teammates were identically configured (same subagent_type, mode, backend, model). Only 1 got stuck.
  • The stuck teammate received and processed messages correctly during its working phase — the issue only manifests after going

idle.

  • Related but different issues: #23415 (tmux backend message non-delivery) and #24307 (delegate mode tool stripping). This bug

is specific to the in-process backend and only affects shutdown/message processing after idle state.

  • Likely cause: race condition or state issue where the teammate's message processing loop stops polling after going idle, while

the idle notification timer continues firing.

View original on GitHub ↗

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