Skip to content

fix(doctor): lint healthy installs without unused database plugins - #175169

Merged
steipete merged 1 commit into
mainfrom
fix/doctor-absent-optional-stores
Oct 17, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/doctor-absent-optional-stores

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: Doctor reports uninspectable database roots on healthy installs after an upgrade when optional database plugins have no stores. This regressed in #174912 and surfaced in main's legacy-operator upgrade survivor.

User Impact

Standalone openclaw doctor --lint can remain clean after a successful legacy upgrade without requiring unused database plugins. Existing stores retain owner schema admission, migration and permission warnings. Update, migration, schema and custody policy are unchanged.

Why This Change Was Made

The inspection worker loaded every port descriptor even when its family had no physical store. The installed package can lack an optional plugin API or a port-only source asset. Discovery now uses its existing filesystem observations to load descriptors only for families with physical stores. Absent-only families retain informational rows with unknown schema facts; missing rows beside a real store retain the family descriptor facts.

The survivor's final Doctor JSON and stderr were also missing from its failure artifact. Both now use the existing bounded, redacted capture path, preserving the original exit status.

Evidence

  • Main hourly 39002992814: update, schema checks, restart and already-current update passed; final Doctor lint exited 1. Its actual JSON/stderr were not retained, so the original finding cannot be claimed from that artifact.
  • Installing that exact candidate package in disposable Docker with empty state reproduces a sole database-root inspection warning. All ten store rows have no issues or pending legacy migrations.
  • A no-mock worker regression on current main fails with discoveryFailed=true; after the fix the file passes 2/2. pnpm test src/commands/doctor-database-engine-inspection.test.ts --maxWorkers=1: 180.76s Vitest /203.62s wrapper, including cold compiled-worker preparation. This boundary needs the real discovery worker and optional-plugin environment.
  • Capture regression: 40 pass /1 fail before, 41/41 after, 13.35s Vitest /17.45s wrapper. Its eight consumer files pass 336 tests, with two existing platform skips, in 244.50s wrapper time.
  • Production core, Doctor-test and scripts-test typechecks; targeted oxlint, boundary lint, formatting and syntax checks; independent P0–P2 review pass. No assertions, timeouts, retries or suppressions were relaxed.
  • The exact published-upgrade-survivor-legacy-operator-state scenario now passes on an isolated Blacksmith Testbox: 522s for the scenario, 17m16s including build/packaging. Its final Doctor result is ok: true, 39 checks run, zero findings; candidate schemas, legacy delivery import, cron ownership, agent turn, and no-op update also pass. Testbox run. PR CI supplies the remaining broad proof.

Related: #175173 fixes a separate temporary plugin-capture context in the same inspection worker; its diff complements this absent-store fix.

Load database port descriptors only when discovery finds a physical store.
Healthy installs do not require optional database plugin APIs just to report
that their stores are absent. Existing stores retain owner schema admission
and unreadable-path warnings. Missing rows beside real stores retain their
family descriptor facts; absent-only families report unknown schema facts.

Update behavior: standalone Doctor remains clean after a successful legacy
upgrade when optional store families have no data. No update, migration,
schema, or custody policy changes. Retain the final Doctor lint output in
bounded, redacted upgrade-survivor diagnostics to expose future failures.

Regression fails before the owner fix and passes afterward. pnpm test
src/commands/doctor-database-engine-inspection.test.ts --maxWorkers=1:
2 passed, 180.76s Vitest /203.62s wrapper (cold compilation dominates).
Capture regression: 41 passed,13.35s /17.45s. Eight consumer files:
336 passed,2 existing platform skips,244.50s wrapper. Targeted production
and test types, lint, boundary lint, format and P2 review pass.
@clawsweeper

clawsweeper Bot commented Oct 17, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T05:38:42.095245Z 22eda58 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime scripts Repository scripts commands Command implementations size: S labels Oct 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR skips database port descriptor loading for absent stores and retains final Doctor lint output in upgrade diagnostics.

Example: Run openclaw doctor --lint with empty state and bundled plugins disabled.

  • Before: Loading an unused Team Reports port descriptor sets discoveryFailed=true and produces a database-root warning.
  • After: Absent stores remain informational, while existing and unreadable stores retain their diagnostic checks.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported, with meaningful worker coverage and recorded upgrade success; independently inspected behavioral evidence remains limited to the harness.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; it records packaged CLI upgrade verification with a clean final Doctor result, supported by a real-worker regression.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Doctor reports uninspectable database roots on a healthy installation because an unused optional database plugin is unavailable.
Reason: The maintainer-authored change restores truthful diagnostics with a small owner-level fix and retains existing safety checks.

Regression provenance

Regression provenance — verified: source commit 6cf7c4775738 by Peter Steinberger; canonical PR #174912 (blame-to-merge-commit).

Merge readiness

✅ Ready for maintainer review

Keep this PR: it fixes a current-main Doctor false warning without weakening existing-store checks, and no introduced correctness or security defect was found.

Priority: P2
Reviewed head: 22eda58992bc3e804d76734de9ee2c6ef18c30ef

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The PR records the shipped legacy-upgrade scenario passing, but its remote output could not be independently inspected because the log host is blocked.
Agent review details

How this fits together

Doctor's inspection worker combines configured database families, plugin metadata, and filesystem observations into per-store diagnostics consumed by text output and lint findings.

flowchart TD
  A[Doctor CLI] --> B[Inspection worker]
  B --> C[Discover physical stores]
  C --> D[Load descriptors for present families]
  D --> E[Inspect stores]
  E --> F[Text and lint diagnostics]
Loading

Technical review

Best possible solution:

Land the existing discovery-owner fix once exact-head required CI completes.

Do we have a high-confidence way to reproduce the issue?

Current main unconditionally loads the Team Reports descriptor even without stores, and that descriptor throws when its plugin API is unavailable; the PR records a failing-before, passing-after worker regression.

Is this the best way to solve the issue?

The change fixes descriptor loading at its existing discovery owner, preserves real-store admission and permission warnings, and adds no competing policy or configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8c7c9f6947eb.

Provenance checked

  • Per-family descriptor loading changes intended behavior with a stated reason (6cf7c47: feat(doctor): truthful per-store database diagnostics #174912 added truthful physical-store diagnostics using family providers and owner descriptors.)
  • Upgrade-survivor diagnostic capture keeps the original intent (b85a049: The existing capture path retains bounded diagnostic logs; the added Doctor outputs use that same redacted publication boundary.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 66ab55c adds scripts/e2e/lib/upgrade-survivor/diagnostics.mjs:97 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 66ab55c4f4dd; files: scripts/e2e/lib/upgrade-survivor/diagnostics.mjs)
  • Dallin Romney: Raw commit bc860ad adds scripts/e2e/lib/upgrade-survivor/diagnostics.mjs:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: bc860ad02ffa; files: scripts/e2e/lib/upgrade-survivor/diagnostics.mjs)

PR surface

Source +6, Tests +34, Docs +1, Other +2. Total +43 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 12 6 +6
Tests 2 35 1 +34
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 51 8 +43

Labels

Label changes:

  • add P2: Healthy installations can receive a false Doctor lint failure, but the evidenced defect does not prevent the upgraded Gateway from running.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Healthy installations can receive a false Doctor lint failure, but the evidenced defect does not prevent the upgraded Gateway from running.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 17, 2026, 2:05 AM ET / 06:05 UTC.

@steipete
steipete merged commit 732b6e6 into main Oct 17, 2026
148 of 151 checks passed
@steipete
steipete deleted the fix/doctor-absent-optional-stores branch October 17, 2026 06:08
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…175169)

Load database port descriptors only when discovery finds a physical store.
Healthy installs do not require optional database plugin APIs just to report
that their stores are absent. Existing stores retain owner schema admission
and unreadable-path warnings. Missing rows beside real stores retain their
family descriptor facts; absent-only families report unknown schema facts.

Update behavior: standalone Doctor remains clean after a successful legacy
upgrade when optional store families have no data. No update, migration,
schema, or custody policy changes. Retain the final Doctor lint output in
bounded, redacted upgrade-survivor diagnostics to expose future failures.

Regression fails before the owner fix and passes afterward. pnpm test
src/commands/doctor-database-engine-inspection.test.ts --maxWorkers=1:
2 passed, 180.76s Vitest /203.62s wrapper (cold compilation dominates).
Capture regression: 41 passed,13.35s /17.45s. Eight consumer files:
336 passed,2 existing platform skips,244.50s wrapper. Targeted production
and test types, lint, boundary lint, format and P2 review pass.
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 gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: S 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