feat(buzz-acp): make BUZZ_ACP_IDLE_POOL_SLEEP configurable per agent, or document why it must not be
Request
BUZZ_ACP_IDLE_POOL_SLEEP decides how long an agent's pool survives process-wide silence before every cached session is destroyed. The Desktop sets it to 900s and reserves the key, so it cannot be set from Edit agent → Advanced → Environment variables:
the following env vars are reserved by Buzz and cannot be overridden: BUZZ_ACP_IDLE_POOL_SLEEP
There is no UI field either, so fifteen minutes is fixed for Desktop-managed agents.
I would like to raise it. If there is a good reason it must stay fixed, that is a fine answer — but it is not currently written down anywhere a user would find it, and the reserved-list comment ("Desktop-owned pool lifetime policy") states the intent without the rationale.
Why fifteen minutes is short for some workflows
Session state is not recoverable once the pool tears down. Nothing is summarised or carried over; the next message starts a new session which is handed only BUZZ_ACP_CONTEXT_MESSAGE_LIMIT thread messages as [Thread Context] (12 by default). So a fifteen-minute interruption during multi-agent work silently costs the accumulated session context, and the discipline it forces — take a summary before ever stepping away — has to be perfect, because the reset is unannounced.
An agent also cannot tell it happened: a fresh session receives the thread history as injected context, which is indistinguishable from retained memory from the inside. Only the harness log records it.
The policy is already reachable through an unreserved sibling
Raising this because it seems more likely to be an oversight than a decision, and because it is the honest state of things:
let idle_pool_sleep_bound = if config.lazy_pool {
Duration::from_secs(config.idle_pool_sleep_secs)
} else {
Duration::ZERO
};
A zero bound means the reaper is never created. BUZZ_ACP_LAZY_POOL is not on RESERVED_ENV_KEYS, so setting it to false disables idle teardown without touching the reserved key — by making the window meaningless rather than changing it.
I have not adopted this, and would rather not: it makes the pool eager, which is the failure mode in #2631 (parallelism 24, ~14 GB), and it could be closed by reserving one more key at any time. Mentioning it because if the fifteen-minute window is genuinely load-bearing, this path arguably should be reserved too — and if it is not, exposing the value directly seems better than leaving a side door.
What would help
Any one of these:
- Remove
BUZZ_ACP_IDLE_POOL_SLEEPfromRESERVED_ENV_KEYS, with a sane floor if a minimum matters. - Add a field beside Parallelism in Edit agent → Advanced, the way parallelism is exposed while
BUZZ_ACP_AGENTSstays reserved. That precedent seems to fit exactly. - Keep it fixed, and document why — including whether
BUZZ_ACP_LAZY_POOL=falseis a supported way to opt out or an oversight.
Related: #6378 reports the timer tearing down a session that was actively working. Different defect, same subsystem — a configurable window would not fix that one.
Environment
Buzz Desktop 0.5.17, Windows 11, four managed agents, buzz-acp harness. Source read at f88cda9.
The reserved 900s idle pool is the Desktop product limit, not a missing env field. Once the pool tears down, the next message is a new session with a truncated thread dump — raising the window only delays the same cliff. BUZZ_ACP_LAZY_POOL=false trades that for the eager-pool memory failure you already named in #2631, so it is not a real opt-out.
If the job has to keep going after you step away (or the laptop sleeps), it has to live on a box that does not idle-reap the session. Hosted Hermes on a fenced VPS is $10/mo (14-day trial, cancel anytime). Approvals stay in thumbgate.app. Not a second Buzz harness.
+1, with data from running the longer window. In particular, it doesn't "only delay the same cliff": on our workload the cliff was most of the session churn.
Setup: Buzz Desktop 0.5.28 on Linux, 4 desktop-hosted Claude agents (claude-agent-acp) doing multi-step work handed between agents in threads.
At the default 900 s (3 weeks, 940 sessions):
- 61% of sessions were a single prompt.
- 525 of 749 conversation splits happened after a gap of 15 minutes or more, i.e. caused by the idle teardown, not by the work.
- Only 3 auto-compactions in the whole period. Sessions weren't growing too long; they were being thrown away.
At 14400 s (forced with a wrapper around the bundled buzz-acp, since the key is reserved in the agent's Environment variables):
- Pools only slept at the 4 h mark. Sessions survived pauses of up to about 2 h, and one agent kept a single session across 6 prompts over 3 h 42 m.
- Typical pauses (waiting on CI, a review gate, a human reply) no longer reset context.
- Cost of keeping pools warm: peak about 2.35 GB / 47 processes for the busiest agent, about 0.9 to 1.2 GB for the others, on a machine with plenty of headroom. Making the value per-agent lets people with less memory keep 900 s.
Of the three options, option 2 (a field beside Parallelism in Edit agent → Advanced) fits best for us. Resuming sessions via session/load (#6088, #8145) would be the real fix for the cliff, but a configurable window is a much smaller change and covers the common case now.