Repository navigation
[Bug] Default parallelism 24 eagerly spawns large Codex ACP pools, consuming ~14 GB and flooding Recents #2631
Description
Summary
Buzz Desktop 0.4.23 defaults every managed local agent to parallelism: 24 and manual agent starts eagerly initialize the full pool. With Codex ACP, each worker is a multi-process adapter/app-server chain, so a few agents can create hundreds of idle processes, consume double-digit GiB of RAM, and populate Codex Recents with [Base] You are operating inside the Buzz platform... sessions.
This initially looked like an orphan cleanup leak, but controlled shutdown and source inspection show that cleanup works. The problem is the default pool size plus eager manual startup.
Environment
- Buzz Desktop: 0.4.23
- macOS: 26.5.2 (25F84)
- Architecture: arm64
- Hardware: Apple M4 Max
- Agent runtime: bundled
@agentclientprotocol/codex-acp - Model:
gpt-5.6-sol
Reproduction
- Create three local Codex-backed agents using the default parallelism.
- Create one additional local agent with parallelism set to 1.
- Start all four agents from Buzz Desktop.
- Inspect the Buzz-owned process tree and local Codex Recents/state.
Actual behavior
The four agents were configured as 24 + 24 + 24 + 1 = 73 worker slots.
A live process snapshot showed:
- 4
buzz-acproots owned bybuzz-desktop - approximately 220
codex-acp/ Codex app-server descendants - 226 total Buzz-related processes
- 14,359.8 MiB combined RSS
- approximately 0% combined CPU while idle
The process count matches the configuration: 73 worker slots, with roughly three OS processes per Codex ACP worker.
The local Codex state database also contained 40 visible threads titled [Base] You are operating inside the Buzz platform...:
- all 40 had
has_user_event = 0 - 17,721,356 cumulative tokens were recorded across those threads
- threads were created across repeated Buzz agent starts over three days
The token field is reported as supporting evidence of substantial session activity; actual billed usage may differ due to caching/accounting semantics.
Quitting Buzz gracefully removed all 226 processes. Reopening Buzz without starting agents produced one buzz-desktop process at approximately 146 MiB. This confirms the process-tree shutdown path works and this is not an orphan-process report.
Source-level cause
At tag v0.4.23:
desktop/src-tauri/src/managed_agents/types.rssetsDEFAULT_AGENT_PARALLELISMto 24.desktop/src-tauri/src/managed_agents/runtime.rsexports that value asBUZZ_ACP_AGENTS.start_managed_agent_processcallsspawn_agent_child(..., false, ...), disabling lazy-pool startup for the manual start path.crates/buzz-acp/src/lib.rsimmediately callsinitialize_agent_pool(...)whenlazy_poolis false.- In contrast, launch-time restore already uses
spawn_agent_child(..., true, ...), with a comment explaining that eager restore would create “N idle brains.”
Relevant code:
- https://github.com/block/buzz/blob/v0.4.23/desktop/src-tauri/src/managed_agents/types.rs#L729-L735
- https://github.com/block/buzz/blob/v0.4.23/desktop/src-tauri/src/managed_agents/runtime.rs#L1840-L1850
- https://github.com/block/buzz/blob/v0.4.23/desktop/src-tauri/src/managed_agents/runtime.rs#L2100-L2125
- https://github.com/block/buzz/blob/v0.4.23/desktop/src-tauri/src/managed_agents/restore.rs#L310-L335
- https://github.com/block/buzz/blob/v0.4.23/crates/buzz-acp/src/lib.rs#L1260-L1280
Expected behavior
Starting a normally configured local agent should not eagerly allocate 24 model-adapter workers or create user-visible Codex sessions before work arrives.
Suggested fix
- Change the desktop default parallelism from 24 to 1.
- Use lazy-pool startup for manual starts, matching launch-time restore.
- Avoid creating visible Codex Recents entries for idle ACP workers, or archive/reuse them as internal sessions.
- Make higher parallelism an explicit advanced setting with a clear resource-cost warning.
- Add a regression test proving that manual start with default settings does not spawn the full worker pool until the first event arrives.
Even if parallelism 24 remains available for high-throughput deployments, it is unsafe as the default for a desktop installation using Codex ACP.
Activity
fix: reduce default parallelism to 1 and use lazy pool on manual start
moneyteamameen commentedon Jul 27, 2026
Corroborating datapoint from a different runtime: same mechanism with
claude-agent-acpon macOS.Environment
@agentclientprotocol/claude-agent-acpv0.62.0 (Application Supportnode-tools)parallelism: 24,idle_timeout_seconds: null, started manuallyObserved
buzz-acproots owned bybuzz-desktop, each with exactly 24claude-agent-acpnode children = 72 processesConfirmations
managed-agents.jsonhad"parallelism": 24on every agent entry (never set by the user)"parallelism": 1per agent inmanaged-agents.json(with Buzz quit) persists across relaunchSo the mechanism is runtime-agnostic: with claude-agent-acp it is ~1 process / ~43 MB per worker slot rather than Codex's ~3 processes per slot, but the multiplier is the same
24 × agentsdefault.ami230392 commentedon Jul 30, 2026
Additional data point on macOS (Intel, 8 GB), with what looks like a distinct root cause worth separating from the "default is 24" framing: the UI-set parallelism is persisted to a different field than the one the running pool uses.
Environment
claude-agent-acp(preferred_runtime: "claude")Symptom
24 idle
claude-agent-acpprocesses, ~33 MB each, ~790 MB total:All 24 share one parent, are identical in RSS, spawned within a ~10 second window, and sit at 0.0% CPU. On an 8 GB machine this is ~10% of total RAM held by agents that are not in use. Combined with swap pressure it drove sustained CPU throttling (
pmset -g thermshowedCPU_Speed_Limit = 36–47for extended periods).The part that seems new: two fields, only one is honoured
Reducing parallelism in the UI appears to succeed — it persists — but has no effect on the running pool. From
~/Library/Application Support/xyz.block.buzz.app/agents/managed-agents.json:The UI edits (parallelism 1 and 2) landed in
definition_parallelismon entries[0]and[2]. Those entries have no pubkey andlast_started_at: None— they are unregistered local drafts that never run. The entries that actually run are[4]–[7], and their effectiveparallelismremains 10 / 24 withdefinition_parallelism: None.Net effect from a user's perspective: you set parallelism to 1, the UI accepts it, and 24 processes keep running. Repeating the change and restarting the app does not help, because the edit is being written to a record that is never started.
Two secondary observations
builtin-team:welcomeagents default to 24. Entries[5]–[7]are the shipped welcome-team agents and carryparallelism: 24, while the user-created records carry 10. Users who never intentionally created these still pay for a 24-worker pool each. Two of them (Bumble,Honey) hadlast_started_at7 days old and were still holding live processes.idle_timeout_seconds: Noneon all 8 entries. With no idle eviction, a pool spun up once is held for the lifetime of the worker regardless of use. This compounds [Bug] Per-channel ACP sessions are never released: on Windows each live session pins a full agent process tree (~33 procs / ~2 GB), exhausting the commit limit until Windows kills the WebView2 host and the desktop silently renders black #2961 — nothing reclaims workers even when an agent has been untouched for days.Suggested fixes, in order of impact
definition_parallelismto the running pool, or surface a clear "restart required / not applied" state so the setting is not silently ignoredbuiltin-team:welcomeagentsidle_timeout_secondsa non-null default so idle pools shrinkHappy to provide further output from a specific machine state if useful.
eiq-lucky commentedon Oct 28, 2026
Still reproduces on Buzz Desktop 0.5.28 (macOS 27, Apple silicon,
claude-agent-acpandcodex-acp). A specific part of it: an agent started with Stop/Start on its card never releases idle sessions, while the same agent started at Desktop launch does.Observed (live process env of each
buzz-acp):BUZZ_ACP_LAZY_POOLBUZZ_ACP_IDLE_POOL_SLEEPtrue900false0Three agents restarted from their cards held 52 idle sessions (~14 GB) after a few hours and pushed a 36 GB machine into swap. Relaunching Desktop brought all of them back lazy (
true/900) and memory dropped to ~3 GB.Code path (source at 6861e18):
commands/agents.rs:307->start_managed_agent_process(managed_agents/runtime.rs:904), which callsspawn_agent_child(..., false, ...), i.e.lazy = false.runtime.rs:615then setsBUZZ_ACP_LAZY_POOL=false, andagent_env.rsidle_pool_sleep_env(false)returns"0", so idle re-sleep is disabled.restart_managed_agent_runtimego throughstart_pair(..., true, ...)(runtime_commands.rs) and are lazy.Expected: the card's Start uses the same lazy start as launch restore (or at least keeps the idle pool sleep), so the start path doesn't change the memory lifetime of an agent.
Workaround: never use Stop/Start on the card; quit and reopen Desktop instead.