Lead session exits cleanly seconds after a teammate approves a shutdown_request (2.1.280, in-process teammate)
Summary
On 2.1.280 the lead session process exits, with no error and no crash report, about 2.5 seconds after an in-process teammate approves an object-form shutdown_request. The teammate's SendMessage never receives a tool_result. The user has to resume the session by hand. On 2.1.220 through 2.1.270 the same sequence (roughly 100 inbound shutdown_response approvals across our transcripts) never ended the lead.
Environment
- Claude Code 2.1.280, native install, macOS 26 (Darwin 25.6.0), running inside cmux
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1,teammateMode: "in-process"- The lead was in plan mode at the time; the teammate had earlier spawned a nested subagent
Timeline (2026-09-22 UTC)
- 21:42:59.0: lead sends
SendMessage({to: "<teammate>", message: {type: "shutdown_request", reason: "..."}}), gets a request id back, and yields the turn - 21:43:01.8: teammate sends
SendMessage({to: "team-lead", message: {type: "shutdown_response", request_id: "...", approve: true}}); notool_resultfollows in its transcript - 21:43:04.4: the lead process closes all of its sockets (unified log); the process is gone
Ruled out: no crash report, no jetsam event, no launchd or signal entry, no cmux close event. The exit was clean enough that cmux's auto-resume did not fire. The only 2.1.280 sessions where the lead survived a teammate shutdown called TaskStop on the teammate within a second of the request, before any response arrived.
Steps to reproduce
- Start a session in plan mode with Agent Teams enabled.
- Spawn a named in-process teammate; optionally have it spawn one nested subagent.
- Send the object-form
shutdown_requestto the teammate and yield the turn. - The teammate approves; the lead process exits.
Whether the plan-mode lead or the nested child is required is not isolated; both were present in the reproducing run. Related: #77076 (lead exits on an unsolicited shutdown_approved, 2.1.207, closed as inactive).
Expected
The lead marks the teammate terminated and continues its turn.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗