buzz-acp: idle pool teardown kills an in-flight session waiting on background subagent notifications (queued wakeup lost, no stop bookkeeping)
Summary
The buzz-acp idle-pool teardown fires while a session is mid-task and waiting on background subagent task-notifications. The teardown destroys the agent pool and the queued wakeup with it. The task dies silently: no error, no stop bookkeeping, and the delegation thread never gets a report.
Environment
- macOS 26.6.1 (arm64), Buzz Desktop managed agent
- claude-agent-acp 0.66.0
- buzz-acp config from the log:
idle_timeout=900s max_turn=7200s agents=10 subscribe=Mentions dedup=Queue
What happened (all times UTC, 2026-08-19)
A managed agent picked up a delegated investigation and worked normally:
- 20:24:16 delegation event arrives; 20:24:18
agent_pool_ready agents=10. - 20:25:33 the agent posts a pickup message in the thread.
- 20:26:34 to 20:26:55 the session launches three background subagents (Claude Code
Agenttool,run_in_background: true). - 20:27 to 20:38 the session reads code and logs interim findings. Turn structure: each mini-turn ends, then a background task-notification re-wakes the session.
- 20:39:25.689 the third subagent result arrives as a queued task-notification. This is the LAST transcript entry. Zero assistant messages follow.
- 20:39:39.430 buzz-acp logs:
idle pool sleep bound reached — tearing pool back to lazy state idle_pool_sleep_seconds=900. This is 13.7 seconds after the notification was queued.
The buzz-acp process stayed alive all night (only relay reconnect lines afterward). managed-agents.json kept last_stopped_at and last_exit_code empty because the harness treated this as a routine idle teardown. Nobody noticed the dead task for 8 hours.
The idle timer does not track real session activity
Two data points from the same process, same night:
- The killed session: teardown at 20:39:39, exactly
pool_ready (20:24:18) + 900son a 30-second tick grid. The session was active almost the entire window (tool calls, transcript writes, a published relay message at 20:25:33). None of it reset the timer. - A control turn at 21:12: one continuous foreground turn, ran 21:12:34 to 21:50:55, pushed a PR and posted its report. Teardown came at 21:51:39, i.e. anchor 21:36:39, which is mid-turn. The turn survived only because it finished before the deadline hit a tick.
So the timer counted nothing from the first session after pool creation, and it stopped counting the second turn about 14 minutes before that turn finished.
Expected
- A session with an in-flight turn, pending background tasks, or a queued task-notification counts as active. The idle timer must not tear it down.
- If a teardown does stop a session, the harness persists stop bookkeeping (
last_stopped_at, reason) so a dead task is visible. - A queued wakeup (task-notification) survives a pool teardown and is re-delivered after the pool is rebuilt.
Actual
The teardown killed a working session mid-task, dropped the queued wakeup, and recorded nothing.
Evidence
Agent log (agents/logs/<pubkey>__<relay>.log):
2026-08-19T20:24:18.004196Z INFO buzz_acp: agent_pool_ready agents=10
2026-08-19T20:39:39.429933Z INFO buzz_acp: idle pool sleep bound reached — tearing pool back to lazy state idle_pool_sleep_seconds=900
Claude Code session transcript (119 entries): last entry at 2026-08-19T20:39:25.689Z is a <task-notification> user message for the third background subagent. The last assistant message is at 20:38:51. The session was never invoked again.
Happy to provide fuller log excerpts.
Additional Windows reproduction of the same idle-pool teardown failure, with a slightly different trigger shape (a successfully steered channel event rather than a background task notification).
Environment
- Buzz Desktop 0.5.19 (Block Windows build)
- Windows 25H2, build 26200.9168
- bundled buzz-acp, 10-agent lazy pool
- @agentclientprotocol/claude-agent-acp 0.64.0
- ACP protocol version 1; steering_supported=true
Timeline (UTC, 2026-08-26)
The pool initialized and became ready:
20:15:35.306 agent initialized ... name="@agentclientprotocol/claude-agent-acp" version="0.64.0"
20:15:37.523 agent_pool_ready agents=10
A delegated-review event was then accepted as a successful non-cancelling steer into an existing session:
20:16:01.904 steer success: renewed hard deadline (7200s from now)
20:16:01.904 non-cancelling steer ack received
event_id=4d499f5e919f08a26feb5561a2abbfa68799aab51ebd741cd8aa08d2b0f75fbf
ack=Ok(Success { session_id: "9d6c39b5-7f6d-4727-8d3b-a067e837537c" })
release_withheld=false drop_withheld=true signal_fallback=false
20:16:01.904 extending in-flight deadline by 7200s + 100s buffer
Despite that accepted in-flight steer and extended hard deadline, the pool tore down at its 900-second idle bound. The stream closure was the immediately following log line:
20:30:46.287 idle pool sleep bound reached - tearing pool back to lazy state
idle_pool_sleep_seconds=900
Session 9d6c39b5-7f6d-4727-8d3b-a067e837537c:
query stream error: ACP connection closed
No pickup, completion, or failure message from that turn was published to the originating thread. Observers saw a correctly addressed, accepted request and then silence.
This independently supports the issue's core finding: the idle-pool timer can expire while buzz-acp still has an accepted/in-flight session. It also shows the teardown/stream-close ordering on Windows. The log sequencing does not establish why the session produced no intervening output, but it does establish that the 7,200-second in-flight deadline did not protect the session from the 900-second pool teardown.
Expected behavior:
- Do not tear down the pool while any channel/session is in flight, including a successfully steered session.
- If teardown closes an active ACP stream, retain/requeue the triggering event or publish a bounded failure notice to its originating thread.
- Persist stop/failure bookkeeping so the accepted -> dispatched -> complete/fail lifecycle is observable.
Related visibility request: #5196.
Additional reproduction (2026-09-18, Buzz Desktop managed agent)
Same failure mode observed again today on a production Buzz Desktop deployment. Sanitized log excerpts below (channel/session/event IDs redacted).
Config (from startup line): BUZZ_ACP_LAZY_POOL=true, idle_pool_sleep=900s, max_turn=7200s, agents=10, subscribe=Mentions, dedup=Queue
Timeline (UTC):
15:38:25 agent_pool_ready agents=10
15:55:44 non-cancelling steer ack received → Success { session_id: "<session-a>" }
15:55:44 extending in-flight deadline by 7200s + 100s buffer scope=conversation
16:00:40 non-cancelling steer ack received → Success { session_id: "<session-a>" }
16:00:40 extending in-flight deadline by 7200s + 100s buffer scope=conversation
16:10:01 non-cancelling steer ack received → Success { session_id: "<session-a>" }
16:10:01 extending in-flight deadline by 7200s + 100s buffer scope=conversation
16:22:34 idle pool sleep bound reached — tearing pool back to lazy state idle_pool_sleep_seconds=900
The session had been actively working for ~44 minutes (steer acks + in-flight deadline extensions throughout). Teardown fired at pool_ready + 900s on the 30s tick grid — steer acks did not reset the idle-pool sleep clock.
Follow-on: phantom queue state
After teardown, subsequent messages to the same channel were routed as non-cancelling steers into the dead session rather than waking a fresh turn. Example ~38 minutes later, after manual pool rebuild:
17:04:48 non-cancelling steer ack received → Success { session_id: "<session-b>" }
17:04:48 extending in-flight deadline by 7200s + 100s buffer scope=conversation
The dispatch was accepted by the relay but produced no agent response — only routine steer-ack bookkeeping. Recovery required restarting the agent's buzz-acp instance; no on-disk queue file to edit.
Frequency: 17 idle-pool teardown ticks on this agent in the prior 25 hours; most hit truly idle pools harmlessly. When a turn is in flight, the turn dies mid-tool-call with no Stop hook and an orphaned tracker row.
Workaround in use: grep agent log for idle pool sleep bound reached / shutting down; restart that agent's buzz-acp before posting again to the affected channel.
Cross-ref: looks related to #7171 (idle clock not refreshed on steer/turn activity) and #7720 (steer ack masking lost work).
Buzz Desktop desktop-v0.5.23 (latest desktop tag in the repo; installed 2026-09-05), buzz CLI buzz.exe dated 2026-09-05 (no version string; buzz --version is not a valid argument). Relay: a Buzz-hosted community relay (*.communities.buzz.xyz), not self-hosted. OS: Windows 11 Pro 10.0.26200, Hyper-V VM; agents run via buzz-acp with the Claude runtime.
buzz-acp --idle-pool-sleep help text says the pool is torn down only when no turn is in flight.
Observed 2026-09-15 (earlier build): five teardowns idle pool sleep bound reached ... idle_pool_sleep_seconds=900 exactly 900 s after the last INCOMING message, while the agent was still working; two finished verdicts were never published. Setting BUZZ_ACP_IDLE_POOL_SLEEP=0 as a user env var had no effect (Desktop sets the variable per agent process itself).
Observed 2026-09-19 on 0.5.23 (VM): agent log 12:00:16Z extending in-flight deadline by 7200s, 12:12:03Z idle pool sleep bound reached - teardown despite the extended in-flight deadline.
Expected: no teardown while a turn is in flight, or a documented way to raise the bound.
Log path: %APPDATA%\xyz.block.buzz.app\agents\logs<pubkey>__
Follow-up to my comment above: we built PR #7173 on top of desktop-v0.5.23 and measured it against the installed binary.
Setup: one throwaway managed agent, same key and the same environment Desktop uses when it spawns the process after an app restart (BUZZ_ACP_LAZY_POOL=true, BUZZ_ACP_IDLE_POOL_SLEEP=900, Claude runtime, default idle timeout 1500 s), workdir and relay unchanged. The prompt keeps one turn busy for about 18 minutes and then posts a "done" line to the channel. Two runs, only buzz-acp.exe differs.
Run (a), installed buzz-acp.exe from desktop-v0.5.23 (2026-09-05): turn starting 08:21:59Z, turn complete (end_turn) 08:40:21Z, turn length 1102 s. "idle pool sleep bound reached - tearing pool back to lazy state idle_pool_sleep_seconds=900" at 08:40:51Z, i.e. 30 s after the turn completed (first reaper tick). The 900 s were counted from the start of the turn.
Run (b), desktop-v0.5.23 + PR #7173 (patch applied with git am, resulting diff identical to the PR diff, cargo build --release -p buzz-acp, rustc 1.95.0 msvc): turn starting 08:53:17Z, turn complete 09:11:32Z, turn length 1096 s. Sleep bound at 09:26:39Z, i.e. 906.6 s after the turn completed, none before. The clock now counts from the end of the turn.
In both runs the "done" line reached the channel, and there was no teardown while the turn was in flight (the in-flight gate held for the full 1102 s in (a), including two steers that extended the deadline). So #7173 does what it says: the idle bound is measured from the last completed turn instead of the last incoming message. Confirmed on Windows 11 (Hyper-V VM) with the Claude runtime.
One thing worth knowing when reproducing: an agent freshly saved in Desktop is spawned eager with BUZZ_ACP_IDLE_POOL_SLEEP=0 (no reaper at all); the 900 s bound only applies to agents spawned lazily, i.e. after an app restart or via the start button (agent_env.rs, restore.rs, runtime_commands.rs). A fresh test agent therefore never shows the teardown.
+1 — fleet-scale repro data (macOS, Buzz Desktop managed agents)
Building on @tonyswartz's Sep 18 comment and the Windows repros above. Our fleet hits this constantly; the Sep 21 hockey incident is a textbook cascade.
Environment
- Buzz Desktop managed agents (Jeeves + fleet), macOS 26, community relay (
*.communities.buzz.xyz) BUZZ_ACP_LAZY_POOL=true,idle_pool_sleep=900s,max_turn=7200s,idle_timeout=1500s,agents=10- Claude runtime via bundled buzz-acp
Frequency (Jeeves agent log, current relay)
| Metric | Count |
|---|---|
Total idle pool sleep bound reached teardowns |
170 |
| Last 14 days | 68 (~5/day) |
ExpectedRunIdMissing phantom steers (Sep 21–22) |
9 |
Most teardowns hit truly idle pools harmlessly. When a turn is in flight — or when steer acks keep extending the hard deadline — the pool still tears down at pool_ready + 900s on the 30s reaper tick. Steer acks do not reset the idle-pool sleep clock (matches @salvatoremira1969-rgb's PR #7173 A/B on Windows).
Sep 21 cascade (hockey channel, UTC)
03:38:58 idle pool sleep bound reached
04:44–04:58 steer acks → Ok(Err(ExpectedRunIdMissing)) on channel 6724af93… (hockey)
05:29:28 idle pool sleep bound reached (again)
Messages steered into the dead session after teardown; no agent response, only bookkeeping. Watchdog escalated ~1.3h later. Recovery: manual Stop→Start of Jeeves in Buzz Desktop → Agents.
Same pattern on #seo and other channels the same day — phantom steers with ExpectedRunIdMissing after pool teardown, not during an active turn.
Workarounds in use (while upstream fixes land)
These match what others report; we've automated the detection side locally:
- Restart buzz-acp after teardown — grep agent log for
idle pool sleep bound reached; Stop→Start that agent in Desktop before posting to its channels again. (Same as @tonyswartz's Sep 18 workaround.) - Proactive teardown + phantom-queue alerts — our project-tracker watchdog (10-min cron) now DMs when (a) idle pool just tore down, or (b) steer acks land in a session whose jsonl stopped — with restart instructions.
- launchd cron bypass — scheduled workflows use local launchd instead of Buzz workflow @mentions (#3858 still unmerged).
- Per-channel wedge recovery — posting from a new channel spawns a fresh session while the old channel stays black-holed (@cristiansotogarciaxatech on #4127); Desktop agent restart clears it fleet-wide.
BUZZ_ACP_IDLE_TIMEOUT> shell-tool max — we run 1500s; raisingBUZZ_ACP_IDLE_POOL_SLEEPvia user env var has no effect (Desktop sets 900 per process, per #6381).
Endorsements
- #7173 / #6519 — idle clock should anchor on turn settlement, not first dispatch. @salvatoremira1969-rgb's controlled A/B on Windows confirms the fix: teardown moves from ~30s after turn end to ~900s after turn end, with no in-flight teardown during an 1100s turn.
- #5598 — dropped JSON-RPC
dataon agent errors masks root cause (Prompt is too longvs bare-32603); linking here for anyone debugging silent session death. - #4127 / #4369 — dead-session recycling + per-channel wedge is the follow-on once teardown is fixed.
Happy to re-test #7173 on macOS if a desktop build ships with it.
Another case on Buzz 0.5.28 (buzz-acp), claude-agent-acp 0.61.0, macOS 27.0.1, managed agent with BUZZ_ACP_LAZY_POOL=true, BUZZ_ACP_IDLE_POOL_SLEEP=900, BUZZ_ACP_MULTIPLE_EVENT_HANDLING=steer, BUZZ_ACP_AGENTS=10.
Timeline (UTC, 2026-10-27), from the agent log:
- 05:11:23
agent_pool_ready agents=10. One long task starts in a DM conversation. - 05:21 to 06:00: the delegator sends 8 more messages to the same conversation. Each one is steered into the running turn:
non-cancelling steer ack received,steer success: renewed hard deadline (7200s from now),extending in-flight deadline by 7200s + 100s buffer. The last steers are at 05:55:32 and 06:00:01. - 05:48:16: one message in that series has no steer lines in the log.
- 06:03:40
idle pool sleep bound reached — tearing pool back to lazy state idle_pool_sleep_seconds=900. This is 15 min 24 s after 05:48:16, and 3.5 min after the last successful steer. - The agent wrote files in the repo until 06:03:37, 3 s before the teardown. Then nothing: no error, no stop message in the chat. The task stayed half done until a new mention re-woke the pool at 06:13:16.
Same pattern seen on 2026-10-25 (steer ack 05:50:29, teardown 05:59:14) and on 2026-10-20 and 2026-10-21.
What it looks like from outside: steered messages renew the turn's hard deadline but do not count as activity for the idle-pool timer. The reaper also does not see the steered turn as in flight. So any long task that gets follow-up messages dies about 15 min after the last message that was not steered.
Workaround for now: BUZZ_ACP_IDLE_POOL_SLEEP=7200 (or 0).