Repository navigation
fix(codex): avoid startup failures from unrelated unreadable processes - #133111
Conversation
Avoid blocking known-PID registration on unrelated unreadable processes and distinguish deadline failures from access denial. Preserve full-tree containment, command fingerprints, and fresh signal identity checks. Fixes #133101.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 2:35 AM ET / 06:35 UTC. ClawSweeper reviewWhat this changesThe PR limits Codex startup registration checks to the observer and registered parent/child processes, adds typed inspection diagnostics, and keeps full-tree inspection for destructive orphan cleanup. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer handling. Current main still performs full-host inspection at the registration gate, while this branch scopes registration to known identities and retains full-tree checks before signals; however, the required direct Codex-source check is unavailable in this environment and the PR carries the protected Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin launches a managed stdio app-server and stores its process identity to reconcile stale children before later starts. Registration decides whether a known child may be retained or added, while containment revalidates a complete process tree before sending operating-system signals. flowchart LR
A[Codex session startup] --> B[Stored child identity]
B --> C[Scoped registration inspection]
C --> D[Launch and register child]
B --> E[Full process-tree inspection]
E --> F[Fresh identity recheck]
F --> G[Orphan cleanup signals]
Decision needed
Why: The branch relies on that upstream lifecycle contract, and the repository policy requires a direct source inspection; this review environment has no usable Codex checkout. Before merge
Agent review detailsSecurityNone. PR surfaceSource +82, Tests +293, Docs +7. Total +382 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep scoped inspection exclusively at the non-destructive registration owner, retain complete-tree plus fresh-identity checks for every signal, and record a direct inspection of the matching Codex app-server source before merging. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main’s registration gate requires a full snapshot before checking the known parent, and the added procfs fixture models an unrelated Is this the best way to solve the issue? Unclear pending the required direct Codex source check. The implementation is otherwise owner-bound in source: scoped reads are used only for registration, while containment remains full-tree and fail-closed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3f1c84c706bf. 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
|
Maintainer verification for
|
|
Merged via squash.
|
…enclaw#133111) Avoid blocking known-PID registration on unrelated unreadable processes and distinguish deadline failures from access denial. Preserve full-tree containment, command fingerprints, and fresh signal identity checks. Fixes openclaw#133101.
Closes #133101.
What Problem This Solves
Fixes an issue where starting a Codex-backed session could fail because an unrelated host process was unreadable, even though the registered parent and child identities were available. Inspection deadline failures also incorrectly told operators to change process-inspection permissions.
This is a reproduced registration-boundary defect, not a claim that the exact syscall or CPU cause of the original concurrent-host incident has been identified.
Why This Change Was Made
The canonical process inspector now supports inspecting the observer and known parent/child PIDs for non-destructive registration decisions. Destructive containment still requires a full process-tree snapshot, command fingerprint validation, and fresh identity checks immediately before signals; unreadable required identities remain fail-closed and keep their registrations.
The inspector distinguishes deadline, access-denied, and unavailable/invalid identity failures. An unreadable command can lose its fingerprint obligation only after a successful subsequent identity inspection proves disappearance or replacement. This keeps uncertainty distinct from absence.
No permission expansion, additional retries, larger deadlines, dependency/configuration changes, store/schema changes, or alternate inspection/cache path. Existing Windows behavior and natural startup-exit, cancellation, and owner-revocation precedence are preserved.
User Impact
Unrelated unreadable processes no longer prevent known-PID registration on Linux. Operators get an actionable failure reason rather than a misleading permission diagnosis for a timeout. Recovery guidance is updated at https://docs.openclaw.ai/plugins/codex-harness-runtime.
macOS still uses native
ps; this does not claim that its kernel implementation avoids global enumeration. Full cleanup can still refuse to proceed when the process tree cannot be inspected safely. Synchronous database blocking is not removed by this patch.Evidence
transport-process-registration.procfs.test.tsfailed against unchanged production, then passed with the fix. The test uses the real registration owner and isolated plugin-state store; only the procfs I/O boundary is faulted.pnpm buildpassed. Fresh Codex autoreview of the final diff was scoped-clean at the default P0 threshold.node scripts/check-changed.mjs --stagedpassed, including production/test typechecks, lint, plugin boundaries, doctor-contract tests, and runtime import-cycle checks.ProcessInspectionError.reason = "deadline"; the non-overlapping control passes. No deadline weakening.apply_patchfile write and exactbashreadback from a different session. All active-phase health samples passed. Every turn has the expected provider/model/runtime, one successful attempt, and a non-rerouted terminal receipt; no application fallback. Startup pressure is recorded separately.openai/gpt-5.6-sol/Codex sessions and one directanthropic/claude-sonnet-4-6session. Both runs hit the unchanged transient CPU-health guard (parent delay max 112.3 ms; candidate 118.9 ms), stayed ready, and recovered without restart. Both load probes therefore remain incomplete, and neither submitted write/recall followups. The passing serial smoke is not substituted for a passing stress test.blacksmith-testbox, leasetbx_01m18n4t3beaf6sbm49wah9hs5, Testbox run 33296622700. Exact-head CI run 33296687827 passed, includingopenclaw/ci-gate.Proof limits: Docker/Debian and API-key auth are not original Ubuntu/ClawRouter/account-auth parity; source/dist/Node hashes and immutable image IDs were verified before keys were supplied. The first fixture launch omitted explicit multi-agent ownership and stopped before submitting turns; it was corrected and its failed evidence retained. The minimal fixture also logged a pre-wave memory-core reconciliation warning because no system agent was assigned while cron was disabled; memory/dreaming behavior is not certified by this proof. The historical failure's exact errno/CPU cause and the original full stress sequence remain unproven.
Direct dependency inspection: Codex
rust-v0.151.0, peeled commit78c290807ce710180111df227df3b7a4fe845452; initialize gating incodex-rs/app-server/src/message_processor.rs:835-899, stdio EOF incodex-rs/app-server-transport/src/transport/stdio.rs, and single-client shutdown incodex-rs/app-server/src/lib.rs:1004-1024,1165-1174. Registration happens before that native protocol boundary; no upstream behavior is patched.Production LOC: +143/-61 (net +82) across the three existing owner modules. The growth provides scoped inspection, typed diagnostics, and explicit fail-closed consumers; it does not introduce a second reader or a store redesign. Tests: +349/-56 (net +293); docs: +15/-8. Regression provenance of the original historical incident remains unknown; this PR makes no author/introduction attribution.
The operator's Stable Gateway and the protected Usage patch were not modified or exercised. No release or advisory operation is part of this PR.