Repository navigation
fix: start Codex turns after slow registration reads - #153282
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: needs maintainer review before merge. Reviewed September 19, 2026, 8:26 PM ET / September 20, 2026, 00:26 UTC. ClawSweeper reviewWhat this changesStarts the Codex process-inspection budget after durable registrations finish loading and adds a transport-level regression test for slow reads. Merge readiness✅ Ready for maintainer review The fix remains necessary on current main. The focused change correctly separates database-read latency from process inspection, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s Codex plugin checks registered local processes before launching a new app-server. It preserves live owners, cleans up verified orphans, and registers the new child before returning its transport. flowchart TD
A[Codex turn startup] --> B[Load durable registrations]
B --> C[Start inspection budget]
C --> D[Inspect registered processes]
D --> E[Preserve live owners]
D --> F[Clean verified orphans]
E --> G[Spawn and register new child]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +41. Total +43 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep database loading outside the existing inspection budget while retaining process-identity checks and durable registration ordering. Do we have a high-confidence way to reproduce the issue? Yes, from source: a nonempty registration read taking over ten seconds exhausts main’s deadline before inspection starts. The new transport-level regression models that trigger; this review did not execute tests. Is this the best way to solve the issue? Yes. Moving the deadline to the phase it bounds fixes the cause without increasing timeout constants, duplicating ownership, or changing persisted state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 084dfeccb6e1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes: starting a Codex-backed turn can report an orphan-cleanup timeout when reading durable process registrations takes more than ten seconds, before process inspection has even begun.
User Impact
Slow database initialization no longer consumes the time reserved for checking registered processes. Existing startup limits, live-process protection, and cleanup safeguards remain in effect. No configuration change or migration is required.
Why This Change Was Made
The registration read became asynchronous, but the process-inspection deadline still started before that read. The repair starts the existing inspection budget after the registrations arrive; it changes no timeout values or identity checks.
Evidence
The failing CI cases reproduced locally. Temporary phase measurements recorded registration reads of 11,465 ms and 10,935 ms, with neither run reaching process inspection. Those probes were removed before final validation.
A deterministic test through the actual transport entry point fails on the original code and passes with the repair. All 56 cases across registration lifecycle, process inspection, registration, and real fixture/native orphan tests pass. Coverage retains live-owner preservation, command identity checks, genuinely exhausted inspection, containment, and durable cleanup. The two real orphan cases passed with their unchanged 60-second limits.
All 26 selected checks pass, including extension production/test types, lint, dead exports, and runtime/storage guards, plus six doctor-contract cases. Independent review found no actionable issues. Exact-head CI passes.
Related: #153226, whose CI exposed this existing startup-budget failure.