Repository navigation
fix(gateway): settle live fixtures before Codex reconnects - #128965
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 25, 2026, 2:23 PM ET / 18:23 UTC. ClawSweeper reviewWhat this changesThis PR makes Gateway live fixtures use full startup, wait for startup settlement before Codex connections and reconnects, and removes retired per-agent default markers from several fixture inputs. Merge readinessKeep open. The merged CLI slice does not supersede the distinct Codex work, but the live-model fixture still serializes a retired default marker, leaving part of the stated normalization fix incomplete. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherGateway live fixtures start an isolated Gateway, publish prepared runtimes during startup, then connect backend clients to exercise agent turns and delivery. They feed release validation rather than changing production request handling. flowchart LR
A[Fixture configuration] --> B[Gateway startup]
B --> C[Runtime publication]
C --> D[Startup settled]
D --> E[Backend client connects]
E --> F[Agent turn validation]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource 0, Tests -5. Total -5 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make every serialized live Gateway configuration use keyed entries without retired default markers, then retain the startup-settlement waits and validate the rebased exact head. Do we have a high-confidence way to reproduce the issue? Yes, from source: the builder serializes a default marker for live Gateway runs, which the config-load migration removes during startup. A current-main live execution was not run in this read-only review. Is this the best way to solve the issue? No. The startup-settlement waits use the correct Gateway-owned promise, but the live-model config builder still emits the retired marker that the PR intends to eliminate. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 131d1f9b3526. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Real-behavior proof — exact head
|
d46580b to
f9b474a
Compare
f9b474a to
e127538
Compare
36e1b47 to
eff2447
Compare
|
Land-ready on exact head Completed work:
Proof:
Known proof gap: an attempted full provider-matrix run passed 144 tests before its single provider setup case exceeded the existing models.json setup budget. The focused builder proof and prior real Codex Testbox runs cover the changed paths. |
|
Merged via squash.
|
…128965) * test(release): use full canonical gateway fixtures * test(gateway): settle restart before reconnect * test(gateway): remove retired live agent default * test(gateway): isolate deep agent method mocks --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #127710
What Problem This Solves
Fixes an issue where release validation could connect a Codex backend before the Gateway had finished mandatory sidecar startup, producing fixture-induced missing prepared-runtime failures during initial connection or restart/resume checks. The same live fixtures also serialized retired per-agent
defaultmarkers and therefore exercised migration code instead of the canonical keyed-agent configuration.Why This Change Was Made
Codex live validation now awaits the Gateway-owned
startupSettledpromise after every start and before each client connection. All remaining serialized live Gateway configs use keyed agent entries without retired default markers. The already-landed CLI fixture slice is no longer part of this branch, and no production runtime behavior changes.User Impact
Maintainers can trust the affected release checks to validate prepared-runtime publication and restart/resume behavior rather than fixture startup races or legacy config normalization. This PR does not claim to fix the separate production race discussed in #127710.
Evidence
gateway.compaction-hot-reload.e2e.test.ts: 1/1 passed against the built CLI and full Gateway path;agent.test.ts: the Gateway methods project could bind production imports before the suite's deep mocks. The canonical failed-job rerun expanded the same leak to 11 selected-agent/session failures;agent.test.tsnow owns a dedicated isolated Gateway-methods project that retains the shared runner and setup. The complete 284-test suite passes in 35 seconds, and the 23-test project ownership audit passes;pnpm check:changedpassed after the routing repair;97729885d4707a123db31ae80f5fb0eeda6b7706:codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs:124-139binds spawned agents to the parent thread and turn;codex-rs/app-server/src/bespoke_event_handling.rs:1277-1302emits terminal turn status and final agent message throughTurnCompleted.buildLiveGatewayConfigno longer emits the retired marker, and the reduced branch is rebased and re-proved on currentmain.LOC classification against current
main:AI-assisted. I reviewed the Gateway lifecycle owner, every changed fixture, the exact Codex protocol source, and the validation results.