Repository navigation
fix: select Doctor readiness owners before loading health APIs - #135161
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
The original upgrade-readiness error is now reproduced through the actual root-managed Docker fixture, with raw child output captured before the updater's parser. The child ran {"ok":false,"error":{"type":"cli_error","message":"Unable to resolve Codex doctor health API: install the official Codex plugin with openclaw plugins install @openclaw/codex"}}This confirms the failing registration path: an optional health owner throws before readiness selection, and the updater rejects the CLI error envelope because it is not a readiness report. The capture observed 201 stdout bytes, no overflow, SHA256 Diagnostic worker run 33502482276 retained frozen candidate The published baseline was explicitly pinned to The worker, containers, processes, and temporary state are confirmed cleaned up. This is before-fix evidence; the repaired package CLI proof and exact-head CI remain separate landing checks. The successful diagnostic capture does not mean the upgrade passed. |
|
Codex review: found issues before merge. Reviewed September 1, 2026, 7:47 AM ET / 11:47 UTC. ClawSweeper reviewWhat this changesThis PR selects the post-plugin update-readiness health-check owner before loading plugin health APIs, preserving required selected checks and adding focused regression coverage. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this maintainer PR open. The readiness-owner selection correctly avoids loading unselected optional health APIs, but the branch also edits release-owned changelog content that should be removed before merge. Priority: P2 Review scores
Verification
How this fits togetherAfter a plugin update, OpenClaw runs Doctor readiness checks before restarting the Gateway. Bundled plugin registrars supply checks; selected readiness findings either permit restart or return remediation while the Gateway remains stopped. flowchart LR
A[Plugin update] --> B[Post-plugin Doctor command]
B --> C[Select readiness owners]
C --> D[Load selected health APIs]
D --> E[Register and run checks]
E --> F[Restart Gateway]
E --> G[Return remediation]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +67, Tests +78, Docs +5. Total +150 across 8 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the owner-level selection and its focused lifecycle coverage, remove the CHANGELOG.md edit, and let release automation derive the eventual release note. Do we have a high-confidence way to reproduce the issue? Yes, from source and focused regression coverage: configured optional owners are skipped before their loader can throw, while the selected Memory Core check remains runnable and blocking. Is this the best way to solve the issue? Yes for the readiness behavior: phase ownership is selected at the registrar boundary before implementation loading, preserving the existing check identity and ordinary Doctor paths; the release-owned changelog edit is not part of that solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2321d43e542f. 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
|
What Problem This Solves
The post-plugin update readiness gate registers every configured optional Doctor integration before filtering checks for that phase. A configured but unavailable Codex health API therefore throws before the selected memory readiness check can run. The updater receives a CLI error envelope instead of the expected readiness report, obscuring the failure as an invalid readiness result.
Why This Change Was Made
Declare phase membership at the existing bundled health-registration owner and select registration groups before loading their implementations. Carry that declaration onto the original check object through one stable registration callback. This preserves the memory check's identity and refresh lifecycle and makes the registration owner the single source of phase membership.
Ordinary Doctor default/all/only paths preserve existing registrar order, configuration policy, trusted-install checks, and missing advertised API failures. Update readiness still fails if its selected health artifact cannot load or the selected check reports an error. This does not disable configured integrations, download missing artifacts, change runtime model selection, or add a config, manifest, or SDK option.
Evidence
The new missing-unselected-owner reproduction failed before the repair with MissingPublicSurfaceError. After the repair, four focused owner/Doctor/memory suites passed 97 tests. Coverage includes stable check and callback identity across repeated registration, default-disabled behavior, blocking readiness findings, selected-artifact failure, and the real isolated-state Doctor flow with a configured OpenAI model and required memory readiness failure. Existing ordinary Codex trust and registration coverage remains intact.
The original root-managed upgrade failure was reproduced through the actual Docker fixture, capturing the missing Codex health API error before the readiness parser. See the raw before-fix evidence. The published baseline was explicitly pinned to 2026.8.1 because the historical mutable latest resolution was unavailable. This does not certify the original package or a full release run.
Production delta: +67 lines, from extracting the existing five registration owners and selecting them before API execution. This owner boundary requires phase metadata to be available before loading code, while stable callbacks and original check identities preserve existing registration lifecycle contracts. The old executable-only memory phase declaration is removed. Tests and docs are counted separately; no production fallback or retry is added.
The full local changed-file gate and managed Codex review passed on unchanged patch SHA256
9e3ccda2ae28b6fe58a64ec83f8f4b975a7ac323604ecdbc487e01390b06e904. The initial static run stopped on a missing Mermaid dependency in the borrowed local dependency tree; a task-owned link to the identical declared dependency resolved it, and the full gate then passed without source changes or omitted checks. Exact-head CI 33503217895 passed: 201 successful jobs, 16 skipped, and required gate 99843890971 successful.Exact package behavior
Isolated native worker 33504709466 built and normally installed the canonical package from exact head
e63c0d19ef2964e3281f5c4e2061721a3f89b172. Packaging took 289.694 seconds and installation 12.904 seconds. The tarball was 64,690,386 bytes, SHA256950d876f84e94cec27adc8ed5721f739ab5518cd112bb15385e59d63d0bbcc7c; embedded build identity matched the source head.With the normal updater markers, the real installed
doctor --lint --json --severity-min errorcompleted in 1.017 seconds with{"ok":true,"checksRun":1,"checksSkipped":0,"findings":[]}. In a separate fresh home without those markers, ordinary Doctor selectingcodex/managed-app-serverretained the expected nonzero structured missing-official-plugin error (0.969 seconds). The package naturally excludes Codex; no plugin was manually deleted or disabled and no runtime override was added. Configuration and SQLite-family state stayed unchanged; no provider calls or operator service were used. All source paths were unchanged and the owned worker, processes and temporary state were cleaned up.The initial CI artifact was not reused: its embedded identity was GitHub's merge-ref commit, not the exact PR head. That artifact is retained only as rejected provenance evidence; the proof above used a fresh canonical build.
Maintainer review disposition
The latest ClawSweeper finding and rank-up request concern only removing the changelog entry. Skipped under the active maintainer instruction for this task requiring a changelog entry for user-facing fixes; the entry is retained deliberately. No version, release publication, or generated release section is being created. The stored-data warning is a path-based classification, not a schema or migration change: this diff changes registration ownership and selection only, with unchanged-state proof above. There are no table, index, retention, recovery, or persistence-semantic changes.
The repair is entirely before optional API loading. Direct Codex contract inspection included
codex-rs/app-server/src/message_processor.rs:847-890and the app-server initialization contract: this change does not initialize, alter, or bypass a Codex server, its handshake, authentication, or protocol. Ordinary selected-owner trust and missing-API failure remain intact.