Skip to content

fix: select Doctor readiness owners before loading health APIs - #135161

Merged
steipete merged 1 commit into
mainfrom
codex/doctor-readiness-registration-owners
Sep 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/doctor-readiness-registration-owners

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

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, SHA256 950d876f84e94cec27adc8ed5721f739ab5518cd112bb15385e59d63d0bbcc7c; embedded build identity matched the source head.

With the normal updater markers, the real installed doctor --lint --json --severity-min error completed in 1.017 seconds with {"ok":true,"checksRun":1,"checksSkipped":0,"findings":[]}. In a separate fresh home without those markers, ordinary Doctor selecting codex/managed-app-server retained 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-890 and 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.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-core Extension: memory-core commands Command implementations size: S maintainer Maintainer-authored PR labels Sep 1, 2026
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

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 doctor --lint --json --severity-min error with both normal updater markers present and exited 1:

{"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 2ebebb0f21ab29b21a5ea0402de5c3f9ad447ce6daa33b1c3712a5cc91b464c6.

Diagnostic worker run 33502482276 retained frozen candidate 7584f97306af2bdffbede481b67548ed14de62a8, tooling 68cbc3bf8e4483c908d2da8d07a434fac514b099, and the original immutable package, registry, and image bytes. The original fixture order failed at update-candidate after 87.506 seconds. Only a fixture observation hook was added; no product code, model configuration, readiness gate, or timeout changed.

The published baseline was explicitly pinned to [email protected]: the historical run's mutable latest resolution was not recoverable, so this is not claimed as an identical historical-baseline replay. The persisted index had no Codex entry, but runtime trust was not independently resolved; this proves the reported missing health owner, not a separate installation or trust root cause.

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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed September 1, 2026, 7:47 AM ET / 11:47 UTC.

ClawSweeper review

What this changes

This 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 provenance

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep 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
Reviewed head: e63c0d19ef2964e3281f5c4e2061721a3f89b172

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The readiness repair and focused tests are coherent, but the release-owned file must be removed before the patch is ready.
Proof confidence 🌊 off-meta tidepool Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; its supplied focused regression evidence maps to the changed Doctor registration path.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; its supplied focused regression evidence maps to the changed Doctor registration path.
Evidence reviewed 7 items Readiness owner selection: The introduced registration table declares Memory Core as the sole post-plugin owner, and the loop filters owners before invoking their registrars or loaders.
Caller and update entrypoint: Doctor forwards update readiness before registration and filters tagged checks afterward; the updater invokes a fresh Doctor child with the post-core convergence environment marker.
Stable registration lifecycle: Memory Core caches its check by the registration callback, while the PR defines one decorated callback per declared owner; the added test covers ordinary Doctor followed by two readiness registrations.
Findings 1 actionable finding [P2] Remove the release-owned changelog entry
Security None None.

How this fits together

After 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]
Loading

Before merge

  • Remove the release-owned changelog entry (P2) - Release generation owns this file, and repository policy prohibits normal PRs from editing it. Keep the release context in the PR body; leaving this line can create release-note drift or duplication.
  • Resolve merge risk (P1) - The manual release-note entry can conflict with the release-generated changelog process; retain the release context in the PR body instead.
  • Complete next step (P2) - A maintainer-owned, protected PR needs the release-owned-file finding resolved through normal review rather than an autonomous repair lane.

Findings

  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:37
Agent review details

Security

None.

PR surface

Source +67, Tests +78, Docs +5. Total +150 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 3 85 18 +67
Tests 3 80 2 +78
Docs 2 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 170 20 +150

Review metrics

Metric Value Why it matters
Production versus test delta production +67, tests +78, docs/release text +5 The production growth separates five existing registrar owners so phase selection occurs before any optional API load.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-lint.ts, vector/embedding metadata: extensions/memory-core/src/doctor-health.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the owner-level selection and its focused lifecycle coverage, remove the CHANGELOG.md edit, and let release automation derive the eventual release note.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

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

  • [P2] Remove the release-owned changelog entry — CHANGELOG.md:37
    Release generation owns this file, and repository policy prohibits normal PRs from editing it. Keep the release context in the PR body; leaving this line can create release-note drift or duplication.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2321d43e542f.

Labels

Label changes:

  • add P2: This is a bounded update-readiness correction with limited but operator-visible upgrade impact.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; its supplied focused regression evidence maps to the changed Doctor registration path.

Label justifications:

  • P2: This is a bounded update-readiness correction with limited but operator-visible upgrade impact.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The PR is maintainer-authored, so the external-contributor proof gate does not apply; its supplied focused regression evidence maps to the changed Doctor registration path.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Remove the CHANGELOG.md entry and retain its user-facing release context in the PR body.

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 c884a08 into main Sep 1, 2026
279 of 281 checks passed
@steipete
steipete deleted the codex/doctor-readiness-registration-owners branch September 1, 2026 12:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant