feat(codex-fleet): halve worker pool default + cap Node MCP children + idle worker auto-exit#195
Merged
NagyVikt merged 1 commit intoMay 18, 2026
Conversation
…+ idle worker auto-exit
Three changes, all in scripts/codex-fleet/, addressing the ~10 GB
resident memory floor observed when the fleet is up (16 codex CLIs +
258 node helpers; each codex CLI holds 200-400 MB of native heap that
does not shrink while idle).
codex-fleet-2.sh
- New WORKER_COUNT env (default 4, was hardcoded 8). The
RESERVE_ACCOUNTS array is unchanged as the upper bound; spawn loop
iterates 0..WORKER_COUNT-1. Bump back via WORKER_COUNT=8 when a
heavy plan needs more parallel lanes.
- worker_cmd_for() now exports NODE_OPTIONS=--max-old-space-size=400
so any Node MCP-server child codex spawns is capped. codex itself
is native; this only affects Node helpers.
worker-prompt.md
- Added empty_streak counter to the worker loop. After
IDLE_EXIT_THRESHOLD (default 5) consecutive empty
task_ready_for_agent polls (~5 min idle), the worker posts a
Colony note and exits 0. Supervisor respawns it when Colony
reports new claimable work. Override per-pane via
IDLE_EXIT_THRESHOLD=0.
Expected impact
- workers at bringup: 8 → 4
- idle floor when plan exhausted: ~2 GB → ~0
- active-work peak: ~10 GB → ~5 GB
- node MCP child heap cap: unbounded → 400 MB
To activate, tear down + bring up the fleet:
bash scripts/codex-fleet/down.sh
bash scripts/codex-fleet/full-bringup.sh ...
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.
Automated by gx branch finish (PR flow).