Background daemon restart drops in-flight agent workers without respawn (bg adopt: respawned=0 dead=N)

Status Open
Reported on v2.1.214
Maintainer reply None cached
Activity 2 comments · opened Jul 20, 2026

Summary

When the background-agent daemon churns (transient daemons losing lock races and exiting), in-flight background agent workers are dropped and never respawned. On every daemon (re)start, bg adopt logs adopted=0 respawned=0 dead=N — the workers are recognized as dead, but nothing restarts them and no failure notification reaches the session that dispatched them. The result is silent agent death: no final report, no error, work just vanishes.

Environment / scale

  • Claude Code 2.1.214–2.1.215, Linux (WSL2)
  • Heavy multi-agent usage: ~30–50 background agent jobs/day. Symptom onset correlates directly with scaling up from a handful of jobs/day (race odds multiply with volume).

Evidence

  • bg adopt: adopted=0 respawned=0 dead=N on every daemon (re)start (observed N=3,5,2,7,8,12…).
  • Frequent another daemon won the lock race (pid=…) — exiting / another daemon is already running. On 2026-07-18 the daemon restarted 5 times in ~35 minutes (03:49, 03:52, 03:54:04, 03:54:55, 04:25), each restart dropping workers (dead=3/5/1/2).
  • Every claude invocation can spawn a competing transient daemon; the loser exits and its adopted workers are at risk.

Expected

On daemon adopt, live-but-orphaned or recently-dead in-flight workers should be respawned/resumed — or at minimum a worker-lost event should be delivered to the owning session so the dispatcher can react, instead of waiting forever.

View original on GitHub ↗

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