Skip to content

fix: start Codex turns after slow registration reads - #153282

Merged
steipete merged 1 commit into
mainfrom
codex/fix-codex-orphan-startup-budget
Sep 20, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-codex-orphan-startup-budget

Conversation

@steipete

@steipete steipete commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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.

@steipete steipete self-assigned this Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 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.

@steipete
steipete marked this pull request as ready for review September 20, 2026 00:19
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Sep 20, 2026
@clawsweeper

clawsweeper Bot commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 19, 2026, 8:26 PM ET / September 20, 2026, 00:26 UTC.

ClawSweeper review

What this changes

Starts 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
Reviewed head: d30973478674b2e9483bf09530ce039587f5a135

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-level repair with meaningful regression coverage and no blocking correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply. The body reports before/after transport regression coverage and passing native orphan cases; no new authority boundary requires additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply. The body reports before/after transport regression coverage and passing native orphan cases; no new authority boundary requires additional proof.
Evidence reviewed 9 items Current main still contains the defect: Fetched main starts the ten-second deadline before awaiting store.entries(); a nonempty result arriving after that deadline throws before the first process inspection.
Repair and regression coverage: The branch awaits registrations before starting the unchanged inspection budget. The added lifecycle test delays that read by eleven simulated seconds through createStdioTransport, verifies startup succeeds, preserves a live owner, and checks cleanup removes only the new registration. Tests were inspected, not executed during this read-only review.
Spawn and cleanup safeguards: The transport still rechecks current authority after orphan cleanup and after registration. Containment still independently checks process identity before signals. The patch changes neither those checks nor stored registrations, configuration, or plugin APIs.
Findings None None.
Security None None.

How this fits together

OpenClaw’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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +2, Tests +41. Total +43 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 41 0 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 44 1 +43

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: Repairs a bounded Codex startup failure triggered by slow durable registration reads.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply. The body reports before/after transport regression coverage and passing native orphan cases; no new authority boundary requires additional proof.

Label justifications:

  • P2: Repairs a bounded Codex startup failure triggered by slow durable registration reads.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies maintainer-authored work, so the external-contributor proof gate does not apply. The body reports before/after transport regression coverage and passing native orphan cases; no new authority boundary requires additional proof.

Evidence

What I checked:

  • Current main still contains the defect: Fetched main starts the ten-second deadline before awaiting store.entries(); a nonempty result arriving after that deadline throws before the first process inspection. (extensions/codex/src/app-server/transport-process-registration.ts:60, 084dfeccb6e1)
  • Repair and regression coverage: The branch awaits registrations before starting the unchanged inspection budget. The added lifecycle test delays that read by eleven simulated seconds through createStdioTransport, verifies startup succeeds, preserves a live owner, and checks cleanup removes only the new registration. Tests were inspected, not executed during this read-only review. (extensions/codex/src/app-server/transport-process-registration.lifecycle.test.ts:88, d30973478674)
  • Spawn and cleanup safeguards: The transport still rechecks current authority after orphan cleanup and after registration. Containment still independently checks process identity before signals. The patch changes neither those checks nor stored registrations, configuration, or plugin APIs. (extensions/codex/src/app-server/transport-stdio.ts:140, d30973478674)
  • Feature-history routing: Current-main history identifies prior asynchronous registration work by Jason (Json), verified through GitHub as fuller-stack-dev, and several earlier lifecycle changes by Peter Steinberger. Some deeper local history reads failed on unavailable objects; the relevant commit patch was retrieved through the read-only GitHub API instead. (extensions/codex/src/app-server/transport-process-registration.ts:48, 5e825a7bb848)
  • Latest-release comparison: The v2026.9.5 source uses the synchronous registration store and does not contain this proposed repair. Current main uses the asynchronous store but retains the premature deadline. (extensions/codex/src/app-server/transport-process-registration.ts, ec9c1a13db89)
  • Pinned merge scope: The test merge records the pinned base followed by the exact PR head, and its comparison against that base changes only the registration implementation and lifecycle test. Endpoint drift is not attributed to this PR; diff whitespace checks passed. (f822fddf2054)

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.

@steipete
steipete merged commit 877c937 into main Sep 20, 2026
166 checks passed
@steipete
steipete deleted the codex/fix-codex-orphan-startup-budget branch September 20, 2026 00:34
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant