Skip to content

fix(codex): avoid startup app-server bursts for idle agents - #163129

Merged
obviyus merged 1 commit into
mainfrom
fix-163026-codex-catalog-start
Oct 2, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix-163026-codex-catalog-start

Conversation

@obviyus

@obviyus obviyus commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #163026

What Problem This Solves

Fixes a burst of Codex app-server processes when a Gateway starts with many configured agents and explicit Codex homes. Thanks to @609NFT for reporting the remaining startup pressure after #162912.

User Impact

Idle agents no longer start catalog-only app-servers at Gateway activation. Explicit homes hydrate when an authorized catalog request first needs them, using the existing progressive loading behavior. Native turns remain available without prior catalog hydration.

Why This Change Was Made

A concurrency limit on initialization alone would still accumulate retained shared clients. Removing eager fleet hydration avoids both startup fanout and catalog-only retention without changing shared-client pooling, active-turn ownership, stored data, or cache schemas. The service still captures its background execution scope; on-demand catalog hydration and refresh keep their existing owner.

Related history: the inspected history on the touched documentation concerns output projection, scheduled app authority, Computer Use, and managed binary selection, not catalog activation.

Evidence

Real Gateway and packaged native Codex app-servers in an isolated Linux arm64/Node 24.21 container, with 739 synthetic agents and seven additional explicit homes:

Startup measurement Main baseline Candidate
App-server processes spawned / peak live 16 / 16 (8 wrapper/native pairs) 0 / 0
Peak aggregate process RSS, 180-second window 3,315,548 KiB 1,744,276 KiB; repeat 2,247,344 KiB
Gateway readiness 77.84 seconds (earlier sample 78.42) 78.78 seconds; repeat 80.97

Readiness remains approximately 80 seconds; this does not claim a latency improvement. The synthetic profile demonstrates elimination of activation-driven native processes, not reproduction of the reporter's host OOM or blocked-egress timeout count.

  • On-demand catalog RPCs returned the exact three seeded session IDs for agents agent000, agent001, and agent738, including the normal cold catalog_pending transition.
  • Exact-head live gate: zero app-server processes before the request, then agent agent738 completed a real openai/gpt-5.4-mini turn through the codex harness in 4.65 seconds with the expected reply. Utility-model jobs, heartbeat, cron, and model discovery were disabled; one inference turn.
  • Regression fails on the baseline because activation starts resident work; passes on the candidate and verifies that subsequent demand initializes the home. The stop, request-lifetime, homes, backoff, and listing-cache files pass: 41 tests, 34.39 seconds wall total; the changed stop file's three tests took 136 ms.
  • git diff --check passes.
  • Inspected Codex app-server lifecycle at codex-rs/app-server/src/lib.rs:244–307: shutdown drains admitted turns. This fix does not alter that lifecycle or retire a sibling turn's shared connection.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex size: S labels Oct 2, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 8:41 PM ET / October 2, 2026, 00:41 UTC.

ClawSweeper review

What this changes

The Codex plugin defers session discovery until a catalog request needs it, preventing idle agents from starting catalog-only app-server processes during Gateway activation.

Merge readiness

✅ Ready for maintainer review

This PR remains necessary because fetched main still performs eager fleet hydration. The focused repair has relevant before/after runtime evidence, and no introduced correctness or security defect was found.

Priority: P0
Reviewed head: 68dd7840ab806e6f0899a9d2e0f546f3154abc6b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused simplification with relevant production observations and baseline-failing regression coverage supports a good review result.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.
Evidence reviewed 10 items Pinned introduced change: The merge-base-to-head diff removes activation-driven enumeration and initialization, while retaining the same service-scope capture. Only the catalog control, its regression test, and matching documentation are introduced changes.
Still necessary on fetched main: Fetched main retains the loop that starts initialize() for every agent and explicit home without waiting for completion. The latest-release blob could not be retrieved, so no shipped-release claim is made.
Verified three-way merge ownership: The raw test-merge record has the pinned base followed by the exact PR head. Comparing that result with its base shows the same focused catalog change, without removal of unrelated base work.
Findings None None.
Security None None.

How this fits together

The Codex session catalog turns native session listings into OpenClaw’s searchable session inventory. Gateway activation establishes its service scope, while catalog requests load session data through shared Codex app-server clients.

flowchart TD
  A[Gateway activation] --> B[Catalog service scope]
  C[Authorized catalog request] --> D[Resolve configured home]
  B --> E[On-demand hydration]
  D --> E
  E --> F[Shared Codex app-server]
  F --> G[Resident session inventory]
  G --> H[Catalog results]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -27, Tests +14, Docs +1. Total -12 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 32 -27
Tests 1 14 0 +14
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 22 34 -12

Review metrics

Metric Value Why it matters
Observed startup processes 16 baseline → 0 candidate The supplied real Gateway comparison directly measures elimination of the resource fanout this repair targets.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #163026
Summary: This PR specifically repairs the linked startup-hydration defect; the previous heap-allocation repair addresses an adjacent resource limit.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep catalog discovery demand-driven under the existing catalog owner, preserving progressive results and independent native-turn startup.

Do we have a high-confidence way to reproduce the issue?

Yes, fetched-main source establishes the activation fanout for configured explicit homes, and the supplied real Gateway baseline observes it. This reviewer did not execute the reporter’s host-OOM scenario.

Is this the best way to solve the issue?

Yes, removing eager hydration fixes the startup trigger through the existing demand path without adding a queue or changing shared-client ownership.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3ed6eee3e792.

Labels

Label changes:

  • add P0: The linked large-fleet report describes startup process pressure exhausting host memory and forcing Gateway termination.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.

Label justifications:

  • P0: The linked large-fleet report describes startup process pressure exhausting host memory and forcing Gateway termination.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body exercises the changed catalog service through real Gateway startup with packaged native Codex app-servers: zero startup processes after the fix, successful subsequent catalog RPCs, and a real native turn from a cold agent. No stored-data contract changes; the existing snapshot restoration path remains intact.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff removes activation-driven enumeration and initialization, while retaining the same service-scope capture. Only the catalog control, its regression test, and matching documentation are introduced changes. (extensions/codex/src/session-catalog-control.ts:492, 68dd7840ab80)
  • Still necessary on fetched main: Fetched main retains the loop that starts initialize() for every agent and explicit home without waiting for completion. The latest-release blob could not be retrieved, so no shipped-release claim is made. (extensions/codex/src/session-catalog-control.ts:497, 3ed6eee3e792)
  • Verified three-way merge ownership: The raw test-merge record has the pinned base followed by the exact PR head. Comparing that result with its base shows the same focused catalog change, without removal of unrelated base work. (extensions/codex/src/session-catalog-control.ts:492, e159e9fd3f6b)
  • Existing demand path preserved: The registered catalog service invokes the changed start method. Catalog list requests still resolve the resident index; its list operation restores saved state and schedules hydration through the retained background scope. Stop still retires indexes and joins resident requests. No public API, stored format, schema, or configuration value changes. (extensions/codex/src/session-catalog-index.ts:691, 68dd7840ab80)
  • After-fix production observations: The captured PR body reports real Gateway runs with packaged native app-servers in an isolated Linux arm64/Node 24.21 environment using 739 synthetic agents. Startup processes fell from 16 to zero; subsequent catalog RPCs returned the three seeded session IDs, and the exact head completed a real Codex turn in 4.65 seconds. Readiness stayed approximately 80 seconds. These observations prove elimination of activation-driven processes, not the reporter’s exact blocked-egress timeout or host-OOM scenario. Captured context identity: 8e28281929568cd4c80e6bdfbac8ba23dac38644db4b6357257033d388a1e3ac. (68dd7840ab80)
  • Regression and validation: The added lifecycle regression asserts that activation performs no native request, then verifies demand initializes the home and stop settles work. The body reports baseline failure, 41 focused passing tests, and 136 ms for the changed file’s three tests. This reviewer ran only read-only inspection and diff checking, not tests or target code. (extensions/codex/src/session-catalog-stop.test.ts:23, 68dd7840ab80)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus
obviyus merged commit 01d479d into main Oct 2, 2026
104 of 106 checks passed
@obviyus
obviyus deleted the fix-163026-codex-catalog-start branch October 2, 2026 01:30
RomneyDa pushed a commit that referenced this pull request Oct 2, 2026
Closes #163026

## What Problem This Solves

Fixes a burst of Codex app-server processes when a Gateway starts with many configured agents and explicit Codex homes. Thanks to @609NFT for reporting the remaining startup pressure after #162912.

## User Impact

Idle agents no longer start catalog-only app-servers at Gateway activation. Explicit homes hydrate when an authorized catalog request first needs them, using the existing progressive loading behavior. Native turns remain available without prior catalog hydration.

## Why This Change Was Made

A concurrency limit on initialization alone would still accumulate retained shared clients. Removing eager fleet hydration avoids both startup fanout and catalog-only retention without changing shared-client pooling, active-turn ownership, stored data, or cache schemas. The service still captures its background execution scope; on-demand catalog hydration and refresh keep their existing owner.

No overlap with Pash/Sarah changes: their history on the touched documentation concerns output projection, scheduled app authority, Computer Use, and managed binary selection, not catalog activation.

## Evidence

Real Gateway and packaged native Codex app-servers in an isolated Linux arm64/Node 24.21 container, with 739 synthetic agents and seven additional explicit homes:

| Startup measurement | Main baseline | Candidate |
| --- | --- | --- |
| App-server processes spawned / peak live | 16 / 16 (8 wrapper/native pairs) | 0 / 0 |
| Peak aggregate process RSS, 180-second window | 3,315,548 KiB | 1,744,276 KiB; repeat 2,247,344 KiB |
| Gateway readiness | 77.84 seconds (earlier sample 78.42) | 78.78 seconds; repeat 80.97 |

Readiness remains approximately 80 seconds; this does not claim a latency improvement. The synthetic profile demonstrates elimination of activation-driven native processes, not reproduction of the reporter's host OOM or blocked-egress timeout count.

- On-demand catalog RPCs returned the exact three seeded session IDs for agents `agent000`, `agent001`, and `agent738`, including the normal cold `catalog_pending` transition.
- Exact-head live gate: zero app-server processes before the request, then agent `agent738` completed a real `openai/gpt-5.4-mini` turn through the **codex** harness in 4.65 seconds with the expected reply. Utility-model jobs, heartbeat, cron, and model discovery were disabled; one inference turn.
- Regression fails on the baseline because activation starts resident work; passes on the candidate and verifies that subsequent demand initializes the home. The stop, request-lifetime, homes, backoff, and listing-cache files pass: **41 tests**, 34.39 seconds wall total; the changed stop file's three tests took 136 ms.
- `git diff --check` passes.
- Inspected Codex app-server lifecycle at `codex-rs/app-server/src/lib.rs:244–307`: shutdown drains admitted turns. This fix does not alter that lifecycle or retire a sibling turn's shared connection.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 01d479d)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…#163129)

Closes openclaw#163026

## What Problem This Solves

Fixes a burst of Codex app-server processes when a Gateway starts with many configured agents and explicit Codex homes. Thanks to @609NFT for reporting the remaining startup pressure after openclaw#162912.

## User Impact

Idle agents no longer start catalog-only app-servers at Gateway activation. Explicit homes hydrate when an authorized catalog request first needs them, using the existing progressive loading behavior. Native turns remain available without prior catalog hydration.

## Why This Change Was Made

A concurrency limit on initialization alone would still accumulate retained shared clients. Removing eager fleet hydration avoids both startup fanout and catalog-only retention without changing shared-client pooling, active-turn ownership, stored data, or cache schemas. The service still captures its background execution scope; on-demand catalog hydration and refresh keep their existing owner.

No overlap with Pash/Sarah changes: their history on the touched documentation concerns output projection, scheduled app authority, Computer Use, and managed binary selection, not catalog activation.

## Evidence

Real Gateway and packaged native Codex app-servers in an isolated Linux arm64/Node 24.21 container, with 739 synthetic agents and seven additional explicit homes:

| Startup measurement | Main baseline | Candidate |
| --- | --- | --- |
| App-server processes spawned / peak live | 16 / 16 (8 wrapper/native pairs) | 0 / 0 |
| Peak aggregate process RSS, 180-second window | 3,315,548 KiB | 1,744,276 KiB; repeat 2,247,344 KiB |
| Gateway readiness | 77.84 seconds (earlier sample 78.42) | 78.78 seconds; repeat 80.97 |

Readiness remains approximately 80 seconds; this does not claim a latency improvement. The synthetic profile demonstrates elimination of activation-driven native processes, not reproduction of the reporter's host OOM or blocked-egress timeout count.

- On-demand catalog RPCs returned the exact three seeded session IDs for agents `agent000`, `agent001`, and `agent738`, including the normal cold `catalog_pending` transition.
- Exact-head live gate: zero app-server processes before the request, then agent `agent738` completed a real `openai/gpt-5.4-mini` turn through the **codex** harness in 4.65 seconds with the expected reply. Utility-model jobs, heartbeat, cron, and model discovery were disabled; one inference turn.
- Regression fails on the baseline because activation starts resident work; passes on the candidate and verifies that subsequent demand initializes the home. The stop, request-lifetime, homes, backoff, and listing-cache files pass: **41 tests**, 34.39 seconds wall total; the changed stop file's three tests took 136 ms.
- `git diff --check` passes.
- Inspected Codex app-server lifecycle at `codex-rs/app-server/src/lib.rs:244–307`: shutdown drains admitted turns. This fix does not alter that lifecycle or retire a sibling turn's shared connection.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 2, 2026
* fix(state): state read worker loads the whole Gateway graph (+486 MB RSS) (#161003)

* fix(state): keep the state read worker out of the update write graph

Move reconciliation inspection and candidate selection into a read-only
module shared by the state reader and reconciliation writer. The standalone
reader disables code splitting, so its former write-side import also
bundled dynamic failure-fact/Doctor imports and the Gateway runtime.

At release tip 56fb887, the built worker was 52,186,708 bytes with
9,768 esbuild inputs. After this split it is 3,491,598 bytes with 1,025
inputs, measured with packages external for both input graphs.

Keep the read queries, eligibility checks, and transactional reconciliation
bodies unchanged. The full build and 95 focused tests pass.

* test(state): keep standalone workers out of the Gateway server graph

Bundle each standalone entry with esbuild and reject transitive Gateway server, flow, wizard, in-process dispatch, and update-write inputs. Restoring the release-tip reader import and writer exports fails only the state reader with 682 forbidden inputs; the fixed graph passes all nine entries.

Validation: pnpm test test/scripts/runtime-process-build-graph.test.ts --maxWorkers=1 (3.67s wall, 0.678s Vitest); negative control 3.732s wall. oxfmt, oxlint, and independent review pass.
(cherry picked from commit f2715ed)

* fix: retain SQLite workers through package replacement (#162076)

Resolve read-only worker launches through the running updater's retained
generation. Keep session reuse generation-aware and join child work before
retiring its runtime files. This protects future self-updates; an already
loaded 2026.9.6 driver retains its first-hop limitation.

Refs #161865

(cherry picked from commit f59e979)

* fix(update): retry the Windows backup rename on transient locks (#162231)

On Windows the managed update swap renamed the live package tree to its backup location once; a transient EPERM/EBUSY/EACCES from an antivirus, indexer, or Scheduled Task handle failed the swap and rolled the update back. The filesystem owner of the swap now retries those codes with bounded backoff (16 attempts), records each retry, re-checks package identity and update authority between attempts, and reports a named failure after the bound. POSIX behavior is unchanged.

Refs #162027

(cherry picked from commit b5555b0)

* fix: avoid duplicate SQLite copies during update rehearsal (#162403)

* fix: avoid duplicating SQLite snapshots during update rehearsal

* test: target final snapshot publication in race hooks

* test: exercise staging cleanup after snapshot transfer

* docs: describe row-preserving update rehearsals

(cherry picked from commit c77a055)

* perf(update): allow native Git runtime directory copies (#162387)

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 1129326)

* fix: prevent slow Gateway shutdown during memory sync (#162616)

* fix(state): retain publication leases while Gateway drains

* perf(state): preserve normal publication close scheduling

(cherry picked from commit defb7cf)

* perf(gateway): reduce session publication allocations and repeated redaction scans (#162810)

Reduce repeated session-publication allocations and redaction prefilter scans at their lifecycle owners, preserving live recipient authority and byte-identical redaction.

Validated with Node 24 and fork Bun tests, authority negative controls, fixture differential checks, pinned AWS kernel and three-round load benchmarks, a clean post-rebase spot quartet, and green exact-head CI.

(cherry picked from commit 4e4e315)

* fix(agents): bound the shell snapshot cache (#162967)

snapshotCache in src/agents/shell-snapshot.ts was a process-wide Map that retained one entry per distinct cwd/environment key for the Gateway's lifetime, so long-running Gateways with many sessions grew without bound. The owner now reuses the existing LRU cache with a documented 128-entry limit; the active key stays cached and a miss recomputes. At 201k synthetic keys RSS fell from 265 MiB to 232 MiB and live heap from 74 MiB to 6 MiB.

Closes #162582

(cherry picked from commit 24baf01)

* improve: deliver sessions_send replies once

(cherry picked from commit 84c6eb8)

* fix: prevent delegated work from stopping silently

(cherry picked from commit 4f0541e)

* fix(update): canonicalize package activation paths

* test(update): fix the Windows backup-rename regression on native Windows

Inject the platform only into the backup-rename policy. Leave native filesystem staging, verification, and cleanup on the host platform so the Linux policy case reaches its injected EPERM on Windows. Preserve all existing failure, retry, rollback, and content assertions. Refs #162027.

* fix(sessions): keep announce skip token private

* test(sessions): avoid awaiting detached reply flow

* test(ci): include infra in shared Windows partitions (#162310)

* test(release): align backport companion expectations

* test(sqlite): verify snapshot content receipts

* test(subagents): align retired reply token expectations

* test(release): align completion cutover integrations

* test(release): recognize direct peer replies

* test(release): align requester yield guidance

* test(release): align direct session reply fixtures

* fix(release): preserve session continuation authority

* fix(codex): avoid startup app-server bursts for idle agents (#163129)

Closes #163026

## What Problem This Solves

Fixes a burst of Codex app-server processes when a Gateway starts with many configured agents and explicit Codex homes. Thanks to @609NFT for reporting the remaining startup pressure after #162912.

## User Impact

Idle agents no longer start catalog-only app-servers at Gateway activation. Explicit homes hydrate when an authorized catalog request first needs them, using the existing progressive loading behavior. Native turns remain available without prior catalog hydration.

## Why This Change Was Made

A concurrency limit on initialization alone would still accumulate retained shared clients. Removing eager fleet hydration avoids both startup fanout and catalog-only retention without changing shared-client pooling, active-turn ownership, stored data, or cache schemas. The service still captures its background execution scope; on-demand catalog hydration and refresh keep their existing owner.

No overlap with Pash/Sarah changes: their history on the touched documentation concerns output projection, scheduled app authority, Computer Use, and managed binary selection, not catalog activation.

## Evidence

Real Gateway and packaged native Codex app-servers in an isolated Linux arm64/Node 24.21 container, with 739 synthetic agents and seven additional explicit homes:

| Startup measurement | Main baseline | Candidate |
| --- | --- | --- |
| App-server processes spawned / peak live | 16 / 16 (8 wrapper/native pairs) | 0 / 0 |
| Peak aggregate process RSS, 180-second window | 3,315,548 KiB | 1,744,276 KiB; repeat 2,247,344 KiB |
| Gateway readiness | 77.84 seconds (earlier sample 78.42) | 78.78 seconds; repeat 80.97 |

Readiness remains approximately 80 seconds; this does not claim a latency improvement. The synthetic profile demonstrates elimination of activation-driven native processes, not reproduction of the reporter's host OOM or blocked-egress timeout count.

- On-demand catalog RPCs returned the exact three seeded session IDs for agents `agent000`, `agent001`, and `agent738`, including the normal cold `catalog_pending` transition.
- Exact-head live gate: zero app-server processes before the request, then agent `agent738` completed a real `openai/gpt-5.4-mini` turn through the **codex** harness in 4.65 seconds with the expected reply. Utility-model jobs, heartbeat, cron, and model discovery were disabled; one inference turn.
- Regression fails on the baseline because activation starts resident work; passes on the candidate and verifies that subsequent demand initializes the home. The stop, request-lifetime, homes, backoff, and listing-cache files pass: **41 tests**, 34.39 seconds wall total; the changed stop file's three tests took 136 ms.
- `git diff --check` passes.
- Inspected Codex app-server lifecycle at `codex-rs/app-server/src/lib.rs:244–307`: shutdown drains admitted turns. This fix does not alter that lifecycle or retire a sibling turn's shared connection.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 01d479d)

* test(release): make session describe drain bound structural

* fix(release): complete session and drain backports

* test(release): cover cron send cutover

* test(release): align completion prompt expectations

* refactor(gateway): satisfy line caps

* test(gateway): remove stale fixture import

* test(gateway): isolate heartbeat lifecycle cases

* test(gateway): start lazy catalog hydration

* test(ui): tolerate sub-pixel sidebar roster layout (#161068)

(cherry picked from commit 4d638fd)

* test(ui): stabilize model refresh tooltip hover

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Jason (Json) <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

1 participant