Repository navigation
fix(doctor): stop doctor --lint from creating empty PostgreSQL workboard schemas - #182827
Conversation
Defer Workboard persistence-worker admission during tool discovery so read-only Doctor inspection cannot allocate an unanchored PostgreSQL namespace. Keep normal runtime readiness and durable tool execution. Fixes #182771. Supersedes #182790, thanks @etzelm. Co-authored-by: Mitchell Etzel <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR defers Workboard storage initialization during tool discovery until a tool actually accesses storage. Example: Run doctor --lint three times with PostgreSQL Workboard configured under schema prefix issue2.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete current-main side effect with a focused change to Workboard’s existing persistence owner; no actionable correctness or security findings were identified. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor discovers plugin tool schemas against temporary state; Workboard supplies tool factories whose database operations use its existing worker and lifecycle owner. flowchart TD
A[Doctor lint] --> B[Tool discovery registration]
B --> C[Workboard tool factories]
C --> D[Schema inspection]
C --> E[Tool execution]
E --> F[Existing persistence worker]
F --> G[SQLite or PostgreSQL]
Technical reviewBest possible solution: Keep schema discovery free of durable initialization while preserving eager runtime startup and opening the existing worker on first storage use. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the path from temporary inspection state through eager worker startup to fresh PostgreSQL namespace creation, and the linked issue provides isolated CLI results; this review executed no target code. Is this the best way to solve the issue? The patch is the smallest complete fix using existing owners: it delays admission at the producer, preserves executable discovery tools, and retains runtime readiness, operation draining, recovery, and write-authority checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 325c87d46888. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +53, Docs +4. Total +62 across 5 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 24, 2026, 3:54 PM ET / 19:54 UTC. |
…ard schemas (openclaw#182827) Workboard tool registration eagerly opened its store while Doctor discovered runtime tool schemas in anchorless temporary state, so every doctor --lint on a PostgreSQL workboard allocated a new orphan <prefix>_workboard_<hex> schema. Worker admission is now deferred from tool discovery to tool execution. Fixes openclaw#182771. Supersedes openclaw#182790. Thanks @etzelm. Co-authored-by: Mitchell Etzel <[email protected]>
What Problem This Solves
Fixes #182771. Every read-only
doctor --lintrun could leave an empty PostgreSQL Workboard schema behind when Workboard used PostgreSQL.Supersedes #182790, thanks @etzelm (Mitchell Etzel) for the report and fix direction.
User Impact
Doctor can inspect all Workboard tool schemas without creating a Workboard store or PostgreSQL namespace. Executing a discovered tool still opens the durable store and persists its changes. Normal runtime startup remains eager. Existing orphan schemas are left alone; there is no migration or cleanup of operator data.
Release-note context: Doctor lint no longer creates empty PostgreSQL Workboard schemas during runtime tool-schema inspection. Fixes #182771; supersedes #182790; thanks @etzelm.
Why This Change Was Made
Doctor's private inspection state retains the configured PostgreSQL engine but has no Workboard anchor. Workboard registration eagerly opened its persistence worker, which allocated a fresh PostgreSQL namespace; disposing the temporary state then lost the only anchor to it.
The Workboard persistence owner now defers worker admission for tool-discovery registrations until a tool actually uses storage. Disposal of an unused discovery store does not open it. This preserves standalone tool execution and existing runtime readiness instead of changing the database engine's creation policy globally.
Sibling inspection: the database-diagnostics owner snapshots existing anchors and uses read-only SQLite inspection; Crabbox's Doctor contribution uses its host-provided entry reader. Visitor Access, MCP Events, and IMAP defer their runtime state/services until full registration. No matching eager Workboard-style store allocation was found in those paths.
Simplification: one existing worker owner handles eager runtime and deferred discovery admission. Production delta: +18/-13 (net +5); tests: +53/-0; docs: +4/-0. The five production lines retain eager readiness and support cleanup when discovery never opened a worker; no public config/CLI option, dependency, or database schema changes.
Evidence
node scripts/run-vitest.mjs extensions/workboard/index.lifecycle.test.ts --maxWorkers=1failed atexpected true to be falsebecause three schema-discovery/disposal passes createdworkboard.sqlite; six existing lifecycle tests passed. Test time about 2.4 seconds, total runner 75.87 seconds (shared worker/compiler preparation dominated).HOMEandOPENCLAW_STATE_DIR;runDoctorLintCli(runtime, { json: true, onlyIds: ['core/doctor/runtime-tool-schemas'] })completed three passes withchecksRun: 1,findings: [], and exit 0. Repeated afterinstallGatewayDatabaseEngine()selected PostgreSQL for Workboard against the intentionally unreachable fixture endpointpostgresql://127.0.0.1:1/unused: all three passes again exited 0 with no findings. This exercises the real Doctor runner and plugin discovery, without opening a PostgreSQL store.pnpm openclaw doctor --lint --only core/doctor/runtime-tool-schemas --json) stopped at the runtime-artifact publication guard before Doctor ran; no Gateway was stopped or changed. The in-process integration harness above avoids artifact publication.OPENCLAW_VITEST_RUNTIME=node node scripts/run-vitest.mjs extensions/workboard/index.lifecycle.test.ts extensions/workboard/src/sqlite-store-policy.test.ts --maxWorkers=1passed 8 tests in 2 files (56.17 seconds Vitest wall time; 58.43 seconds runner, dominated by shared preparation).test/tsconfig/tsconfig.extensions.test.json; oxfmt andgit diff --checkpassed. The repository type-aware extension lint wrapper exited 0 (no nested-checkout fallback needed); Madge reported 0 cycles.node scripts/check-changed.mjspassed conflict, line-cap, max-lines/env-name, and assertion-safety checks before its SQLite worker inventory step was intentionally interrupted under the campaign's local gate budget. Full check:changed was not completed; PR CI supplies broad proof.Freshness: fetched current
origin/mainimmediately before publication; #182771 remains open, with no intervening main commit touching the three production owners.