Repository navigation
fix(codex): first Codex turn fails on a busy host while the app-server starts - #173716
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c38c762656
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs changes before merge. What this changesThe PR gives shared Codex app-server startup an independent deadline and starts discovery or control-request budgets after acquisition. Example: A cold Gateway receives its first Codex message while the host is heavily loaded.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep this PR open: it addresses a demonstrated cold-start failure, but custom timeout propagation and two stale sibling tests need repair before merge. Priority: P1 Before merge
Findings
Agent review detailsHow this fits togetherThe Codex plugin acquires and initializes a shared native app-server before model discovery and control requests; it returns leased clients and releases or retires them through the existing lifecycle owner. flowchart TD
A[First turn or control request] --> B[Codex request scope]
B --> C[Shared startup owner]
C --> D[Native Codex app-server]
C --> E[Ready client lease]
E --> F[Discovery or control RPC]
F --> G[Lease release and idle retirement]
Technical reviewBest possible solution: Retain independent shared startup, forward canonical configuration through control callers, and align sibling coverage with the new lifetime contract. Do we have a high-confidence way to reproduce the issue? Current-main source shows discovery sharing its short deadline with acquisition and final-waiter cleanup; the author additionally supplies matching live before/after results, although this review ran no target code. Is this the best way to solve the issue? Separating service-owned startup from caller request budgets fixes the owning lifecycle rather than adding retries, but configuration must reach both startup-budget calculations. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 138486fc13fd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource 0, Tests +27, Docs +9. Total +36 across 11 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 15, 2026, 11:34 PM ET / October 16, 2026, 03:34 UTC. |
Baseline-Refresh: b507355fef6beeea389d3b2679e4319d4f9c6e5a
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…r starts (openclaw#173716) * fix(codex): separate shared startup and request deadlines * fix(codex): preserve startup budgets and timeout observations --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes the first Codex turn failing on a busy host when discovery times out while the shared app-server is still starting.
User Impact
A caller abandoning discovery no longer cancels shared startup. Later requests can use the ready server, configured startup budgets are honored, and expired acquisitions release their lease without sending a late RPC. Explicit supervision connections keep their existing connection policy.
Why This Change Was Made
The shared service owns physical startup; each caller owns its wait and subsequent request budget. Timeout normalization now uses the config owner without repeating harness connection admission. Timeout diagnostics and control observations retain the phase that failed before successful cleanup, while cleanup-originated failures retain their own phase.
The original contributor's work and ancestry are preserved. The correction was independently reviewed, then integrated through the native baseline workflow with frozen main
d4babe8e8ba448bd21bdc4c89de0d223a4353faa.Evidence
9a34692c142c9379a21d4971f12cab23eb73a3cd: 159 shared-client tests passed, 92.35s Vitest / 97.64s runner, after a frozen dependency install. This is the suite affected by baseline integration.8ee81894d4ed3bba3330422504b421f9776d0a98: 270 request, diagnostic, shared-client and configuration tests passed, 74.73s Vitest / 79.15s runner. The production changes remain byte-identical in the prepared source. Another 21 registration and command tests passed on the prior correction; those paths are unchanged by the final fixes.Validation limits: the original author's busy-host before/after runtime proof applies to the original PR revision. No new live Gateway/provider call or full evaluation run was performed. Before baseline integration, local typed lint stopped at the SDK declaration generator's 300s timeout under host I/O pressure; the subsequent type check lacked those declarations. No local lint/type pass is claimed. The current head uses the enforced PR CI gate for broad validation.
CI disposition
Exact-head CI run 38867771532 completed with 40 successful jobs, 26 skipped jobs, and one inherited lint failure plus its aggregate gate. The sole root error is
typescript(consistent-return)inui/src/pages/debug/debug-overlay.tsx:115, fixed on main by #173976 (8425c9a0cf88a08614785703753dea3c92811feb).The tested merge
0c185b87b263011369c7009d64b335f491b3e9bbhas baseline0e687614fd9a8b4bca9dde731e1d34348f07366cand this exact PR head as its ordered parents. Its debug-overlay input is byte-identical to that baseline (0ed86224da852044b9b5c81b2b1b71f5ffc83c41); no UI path changes in the PR merge. The aggregate labels it new because the earlier scheduled-main job passed and selected scope was not compared. Native inherited-failure admission uses the inspected job log and unchanged source inputs; this is not a passing full-CI claim.