Skip to content

fix: reduce default parallelism to 1, use lazy pool on manual start#2676

Open
Christian-Sidak wants to merge 1 commit into
block:mainfrom
Christian-Sidak:fix/issue-2631
Open

fix: reduce default parallelism to 1, use lazy pool on manual start#2676
Christian-Sidak wants to merge 1 commit into
block:mainfrom
Christian-Sidak:fix/issue-2631

Conversation

@Christian-Sidak

Copy link
Copy Markdown

Summary

  • Change DEFAULT_AGENT_PARALLELISM from 24 to 1 in types.rs
  • Use lazy-pool startup (lazy: true) in start_managed_agent_process to match launch-time restore behavior

Problem

With the default parallelism of 24, starting agents eagerly initializes the full worker pool via spawn_agent_child(..., false, ...). With Codex ACP backends, each worker spawns multiple processes (adapter + app-server chain), resulting in ~220 idle processes and ~14 GB RSS for just four agents -- before any work arrives.

The launch-time restore path already uses lazy: true with an explicit comment ("eager restore... silently reintroduces N idle brains on every launch"). The manual-start path lacked the same protection.

Changes

  • types.rs: DEFAULT_AGENT_PARALLELISM 24 → 1. Desktop installations should default to a single worker; higher parallelism remains available as an explicit setting.
  • runtime.rs: start_managed_agent_process now passes lazy: true to spawn_agent_child, deferring pool initialization until the first event arrives.
  • types/tests.rs: two regression tests pinning DEFAULT_AGENT_PARALLELISM == 1 and verifying legacy records without an explicit parallelism field deserialize to 1.

Test plan

  • default_agent_parallelism_is_one -- asserts DEFAULT_AGENT_PARALLELISM == 1
  • managed_agent_record_without_parallelism_defaults_to_one -- legacy JSON without a parallelism key deserializes to 1
  • Verified BUZZ_ACP_LAZY_POOL=true is already used by spawn_agent_child when lazy=true (runtime.rs line 1722), so the env-var path is covered by the existing harness

Fixes #2631

@Christian-Sidak
Christian-Sidak requested a review from a team as a code owner July 24, 2026 04:08
Default parallelism of 24 caused eager pool initialization on every
agent start, spawning hundreds of idle processes and consuming ~14 GB
RAM with Codex ACP backends. Matches the lazy-start behavior already
used by launch-time restore (see restore.rs F1 comment).

Fixes block#2631

Signed-off-by: Christian-Sidak <61099993+Christian-Sidak@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Default parallelism 24 eagerly spawns large Codex ACP pools, consuming ~14 GB and flooding Recents

1 participant