Repository navigation
fix(doctor): release stores held by dead agent-database leases and report holds in --json - #186535
Conversation
Expose recovery-owner warnings with reason codes and next steps in read-only Doctor findings, scoped to the requested profile. Preserve existing dead-holder lease reclamation, verified backups, and unresolved ownership holds. Fixes #185843. Thanks @4140leal-cw for the stopped-Gateway reproduction and follow-up diagnostics.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR exposes agent deletion-journal recovery warnings in Doctor JSON and lint reports with reason codes and recovery guidance. Example: The deletion journal is missing while stores for main, contador, and ayudante remain present.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete JSON diagnostic omission still present on main, preserves existing recovery safeguards, and has no actionable findings from this review. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherDoctor inspects configuration and database inventory, passes those facts to the existing deletion-journal recovery owner in preview mode, and serializes its diagnostics through the lint findings pipeline. flowchart TD
A[Doctor CLI] --> B[Read-only inspection scope]
B --> C[Database preflight]
C --> D[Deletion-journal recovery owner]
D --> E[Structured health findings]
E --> F[JSON and lint output]
Technical reviewBest possible solution: Expose recovery-owner diagnostics through the existing read-only findings pipeline while preserving lease reclamation, verified backups, and ownership holds. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the omitted JSON path, corroborated by the reporter's text/JSON comparison and the PR's recorded isolated CLI reproduction; no target code was executed in this review. Is this the best way to solve the issue? The patch is a focused fix: one recovery owner supplies text and structured diagnostics, existing profile scoping is reused, and no competing lease or recovery policy is introduced. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 80b4a31273d5. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +46, Tests +57, Docs +9. Total +112 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 28, 2026, 12:58 AM ET / 04:58 UTC. |
Remove the standalone recovery check and its duplicate full preflight. Report recorded holds and unavailable deletion history through the existing shared-state health check and prepared snapshot, preserving updater check counts and budget gates. Keep the original CI assertions unchanged and prove JSON lint makes zero full-preflight calls. Related: #185843.
Doctor printed agent stores held after deletion-journal reconstruction only in text mode; doctor --json and update lint omitted them. The shared-state lint check now reports each held store as a core/doctor/agent-deletion-journal warning with a reason code and fix hint, reusing its existing read-only snapshot. Dead-holder agent database leases already recover on main. Refs openclaw#185843. Thanks @4140leal-cw.
* commit '04681a3efcb110ecf073fb610eed6e4ea4f87fed': fix(memory): avoid redundant repairs and heavyweight read imports (#186483) fix(doctor): report held agent stores in doctor --json (#186535) fix(ci): complete maintained script and export discovery (#186466) perf(control-ui): restore the Details panel from the cached pane in one step (#185242)
What Problem This Solves
Doctor's text output reports agent stores held after deletion-journal reconstruction, but
doctor --jsonomitted the holds and their recovery actions.Fixes #185843. Thanks @4140leal-cw for the stopped-Gateway reproduction and follow-up table counts.
User Impact
Read-only JSON and lint now identify each held store, its reason code, and its next step. Holds remain warnings; ownership verification and backups still gate restoration. Dead-holder lease reclamation is unchanged and already works on main. No schema, dependency, configuration, or CLI-option changes.
Why This Change Was Made
The original PR added a standalone lint check that repeated full database preflight outside the updater's inspection budget. That registration and its preflight/reconstruction path have been deleted. The existing
core/doctor/state-schemacheck now consumes deletion-owner facts through the same shared-state read callback and prepared snapshot it already uses. Recorded holds come from the reconstruction receipt; unavailable history also reports the existing registry identities. Lint does not discover or open agent stores, reconstruct history, or add a check.Evidence
afebd94596b6reproduced in both files on Bun and Node. Both files now pass 26/26 tests on each runtime, with every original check-count, deferral, required-gate, and elapsed-budget assertion unchanged. Commands:OPENCLAW_VITEST_RUNTIME=bun node scripts/run-vitest.mjs src/commands/doctor-lint.test.ts src/commands/doctor-lint.update-budget.test.ts --maxWorkers=1, then the same command withOPENCLAW_VITEST_RUNTIME=node.prepareDoctorDatabasePreflight, while still requiring the held store's path, agent, reason code, and next step. It also selects a different ambient profile to verify the explicit source profile remains authoritative.HOME/OPENCLAW_STATE_DIR, three registered stores, eight dead-holder leases, and missing history:pnpm openclaw doctor --non-interactive --jsonexits 0, reports 3 per-store hold findings, and runs 41 checks, restoring the pre-PR count from 42. All six source config/database files remain byte-identical.OPENCLAW_UPDATE_IN_PROGRESS=1 pnpm openclaw doctor --lint --severity-min error --only core/doctor/state-schema --jsonexits 0, runs the single existing selected check, and retains all 3 coded hold advisories inwarnings.tsgo, targeted production/testoxlint, formatting,git diff --check, and madge (0 cycles) pass. The fullcheck:changedSQLite inventory was omitted under the campaign's local gate budget; PR CI supplies broad proof.