Skip to content

feat(codex-fleet): halve worker pool default + cap Node MCP children + idle worker auto-exit#195

Merged
NagyVikt merged 1 commit into
mainfrom
agent/claude/halve-worker-pool-heap-cap-idle-worker-e-2026-05-18-14-38
May 18, 2026
Merged

feat(codex-fleet): halve worker pool default + cap Node MCP children + idle worker auto-exit#195
NagyVikt merged 1 commit into
mainfrom
agent/claude/halve-worker-pool-heap-cap-idle-worker-e-2026-05-18-14-38

Conversation

@NagyVikt
Copy link
Copy Markdown
Contributor

Automated by gx branch finish (PR flow).

…+ 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 ...
@NagyVikt NagyVikt merged commit 99e5040 into main May 18, 2026
@NagyVikt NagyVikt deleted the agent/claude/halve-worker-pool-heap-cap-idle-worker-e-2026-05-18-14-38 branch May 18, 2026 12:43
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.

1 participant