fix: reduce default parallelism to 1, use lazy pool on manual start#2676
Open
Christian-Sidak wants to merge 1 commit into
Open
fix: reduce default parallelism to 1, use lazy pool on manual start#2676Christian-Sidak wants to merge 1 commit into
Christian-Sidak wants to merge 1 commit into
Conversation
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>
Christian-Sidak
force-pushed
the
fix/issue-2631
branch
from
July 24, 2026 04:15
652264f to
ce8372b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DEFAULT_AGENT_PARALLELISMfrom 24 to 1 intypes.rslazy: true) instart_managed_agent_processto match launch-time restore behaviorProblem
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: truewith 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_PARALLELISM24 → 1. Desktop installations should default to a single worker; higher parallelism remains available as an explicit setting.runtime.rs:start_managed_agent_processnow passeslazy: truetospawn_agent_child, deferring pool initialization until the first event arrives.types/tests.rs: two regression tests pinningDEFAULT_AGENT_PARALLELISM == 1and verifying legacy records without an explicit parallelism field deserialize to 1.Test plan
default_agent_parallelism_is_one-- assertsDEFAULT_AGENT_PARALLELISM == 1managed_agent_record_without_parallelism_defaults_to_one-- legacy JSON without aparallelismkey deserializes to 1BUZZ_ACP_LAZY_POOL=trueis already used byspawn_agent_childwhenlazy=true(runtime.rs line 1722), so the env-var path is covered by the existing harnessFixes #2631