Repository navigation
Desktop/buzz-acp: idle pool teardown is a hidden 15-minute constant; expose it per agent and refresh the idle clock on turn completion #7
Description
TL;DR: Desktop hard-codes BUZZ_ACP_IDLE_POOL_SLEEP=900 for agents and forbids overriding the key; after 15 minutes of "idle" time the harness tears down the whole worker pool together with all of the agent's sessions. The idle clock is refreshed only when a turn is dispatched, so a turn longer than 15 minutes loses its session right after it completes. We propose exposing the value in the agent card, porting upstream PR block#7173 and unifying the lazy flag across all launch paths.
Problem
Desktop launches every managed buzz-acp with BUZZ_ACP_LAZY_POOL=true and BUZZ_ACP_IDLE_POOL_SLEEP=900 (desktop/src-tauri/src/managed_agents/agent_env.rs:16, const IDLE_POOL_SLEEP_SECS: &str = "900"). The key is on RESERVED_ENV_KEYS (reserved_env_keys.rs:65), so Edit agent → Advanced → Environment variables rejects it, and there is no UI field. After 900 s without a dispatched turn the reaper tears the whole pool down (crates/buzz-acp/src/lib.rs, inactivity_expired at lib.rs:2196, "idle pool sleep bound reached — tearing pool back to lazy state") and with it the sessions map of every thread and channel this agent serves.
Two aggravating details:
- The idle clock only moves on dispatch.
last_activityis set atlib.rs:2894(start),lib.rs:3636(teardown) andlib.rs:4903(dispatch). Turn completion does not refresh it. A turn that runs longer than 15 minutes is "idle" the moment it finishes and is reaped on the next 30-second tick. Observed 2026-09-29: dispatch 07:11:01, last reply 07:25:13, teardown 07:26:16 — one minute after the agent stopped talking. - Behaviour depends on how the agent was started. Agents spawned by the mention preflight path run with
BUZZ_ACP_LAZY_POOL=false,IDLE_POOL_SLEEP=0(observed in/proc/<pid>/environon 2026-09-30: one agent eager, the four agents started via Start/Restart/launch-restore lazy with 900). So the same agent either never sleeps or sleeps after 15 minutes, undocumented, decided by which button spawned it. Note also thatBUZZ_ACP_LAZY_POOLitself is not reserved, which upstream feat(buzz-acp): make BUZZ_ACP_IDLE_POOL_SLEEP configurable per agent, or document why it must not be block/buzz#6381 points out as a side door.
Why it matters
Session state is unrecoverable once the pool is gone (see the companion resume issue). For a human who steps away for 20 minutes, or for an agent that runs a 20-minute test suite, the reset is silent: the next mention gets a fresh session with 12 thread messages and no memory of what it was doing. The team's current workaround is a verbal protocol ("pause, we'll continue in the next session") plus hand-written handoff files.
Proposal
- Expose the value. Remove
BUZZ_ACP_IDLE_POOL_SLEEPfromRESERVED_ENV_KEYS, or better, add an "Idle pool sleep (seconds, 0 = never)" field next to Parallelism in Edit agent → Advanced and in global agent defaults, the way Parallelism is exposed whileBUZZ_ACP_AGENTSstays reserved. Keep 900 as the default. - Refresh the idle clock on turn completion and steer ack. Port upstream PR fix(buzz-acp): refresh idle clocks on turn completion and steer ack block/buzz#7173 (
lib.rs+191, head91957a54, OPEN since 2026-09-01). - One lifetime policy for all spawn paths. Start, Restart, launch restore and the mention-preflight spawn should pass the same
lazyflag (todayruntime_commands.rs:227andrestore.rspasslazy=true,commands/agents.rspreflight passeslazy=false). - Log the teardown as an agent activity event so it is visible in the UI, not only in the harness log.
Cost to document in the UI: a warm pool is BUZZ_ACP_AGENTS (10) worker subprocesses at ~100 MB RSS each, ≈1 GB per awake agent. With 0 the pool lives until Restart or Desktop exit.
Benefit
Owners choose the trade-off (RAM vs. context survival) per agent instead of a hidden 15-minute constant; long turns stop killing their own session; identical behaviour regardless of how the agent was spawned.
References
- upstream: feat(buzz-acp): make BUZZ_ACP_IDLE_POOL_SLEEP configurable per agent, or document why it must not be block/buzz#6381 (make the value configurable, OPEN), fix(buzz-acp): refresh idle clocks on turn completion and steer ack block/buzz#7173 (PR, OPEN), buzz-acp: idle pool teardown kills an in-flight session waiting on background subagent notifications (queued wakeup lost, no stop bookkeeping) block/buzz#6378 (teardown kills turns waiting on background subagents), buzz-acp: idle-pool teardown race silently swallows a concurrently arriving message (no log trace beyond routine steer ack) block/buzz#7720 (teardown race swallows a message)
- fork:
desktop/src-tauri/src/managed_agents/agent_env.rs:16,reserved_env_keys.rs:65,crates/buzz-acp/src/lib.rs:2196,3636,4903
Activity
docs(fork): design visible and controllable agent sessions
feat(fork): visible and controllable agent sessions (#15)
spiritabsolute commentedon Oct 20, 2026
PR #15 is accepted and merged into
mainas258fba8eb89a67451806b4ff4e984981d0432d13. It includes completion-driven idle-clock refresh, session continuity, visible state and scoped context controls.This issue remains open: configurable idle-sleep settings and unified startup/lifetime policy are outside that accepted scope. This comment does not claim those remaining requirements are implemented. Further work should be a separate task; #25 fan-out recovery also remains separate.