fix(codex): bound shared app-server startup waits#89442
Conversation
|
Codex review: needs changes before merge. Reviewed July 11, 2026, 7:13 AM ET / 11:13 UTC. Summary PR surface: Source +52, Tests +201. Total +253 across 4 files. Reproducibility: yes. A real stdio child can receive the actual initialize request and stall, and the production isolated-cron path has a clear outer watchdog that can mask that phase. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Capture one absolute outer startup deadline before setup begins, pass its remaining milliseconds into the shared acquire, and recompute the remainder before initialize/auth phase waits so the specific lifecycle error wins without extending the total watchdog budget. Do we have a high-confidence way to reproduce the issue? Yes. A real stdio child can receive the actual initialize request and stall, and the production isolated-cron path has a clear outer watchdog that can mask that phase. Is this the best way to solve the issue? No, not yet. Moving timeout attribution into the initialize owner is the right boundary, but the implementation must carry the outer watchdog's actual remaining deadline rather than introduce independent fixed-duration waits. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f8aa995856ec. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +52, Tests +201. Total +253 across 4 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (5 earlier review cycles)
|
8931293 to
2c374aa
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
ad61a71 to
19a5def
Compare
9a8d0bd to
81eaca9
Compare
Co-authored-by: 张贵萍0668001030 <[email protected]>
81eaca9 to
24b6bba
Compare
|
Land-ready at exact head What changed:
Proof:
Known proof gap: the reporter-account OAuth/recurring-cron path from #84567 was not reproduced. This lands bounded initialize/auth hardening and leaves #84567 open.
|
|
Merged via squash.
|
Related #84567 and #64744.
What Problem This Solves
Codex app-server startup can stall while the shared client is waiting for the protocol
initializeresponse or post-initialize authentication. Those waits were not independently bounded per caller, so a short caller could either receive a generic outer startup error or retire a physical client that a longer-lived caller still needed.This PR bounds those shared startup phases per acquirer and reports the phase that actually timed out. It hardens the initialize path related to #84567, but does not close that issue: the reporter's authenticated OAuth/recurring-cron failure has not been reproduced here.
Why This Change Was Made
Codex permits one connection-scoped
initializehandshake. The physical app-server startup therefore remains shared, while each OpenClaw caller applies its own initialize and authentication deadline. A caller that times out releases only its pending ownership; the transport closes only when no other pending acquire or active lease remains.The shared startup state now exposes separate
initializedandreadyphases. That preserves accuratecodex app-server initialize timed outversuscodex app-server authentication timed outdiagnostics, while the attempt owner passes the configured app-server request timeout into the client factory. The abandoned-startup retry guard remains in place.The earlier synthetic cron harness was removed. Focused regressions now cover real stdio initialize stalls, concurrent short/long waiters, authentication stalls, claimant-aware cleanup, and late factory results.
User Impact
Stalled Codex app-server initialize and authentication operations fail within the configured request budget with specific diagnostics. A short-lived startup attempt no longer kills a shared client that another caller can still initialize and use. Successful startup, provider/model routing, OAuth profile selection, protocol payloads, and public configuration remain unchanged.
Evidence
24b6bba99aaeb3d8dbf9a3dc898e92e7a597dce6.