Repository navigation
Conversation
|
🦞👀 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: needs real behavior proof before merge. What this changesThis PR defers Workboard store initialization during tool discovery until a tool performs a database operation. Example: Run doctor --lint repeatedly with PostgreSQL Workboard configured under schema prefix issue2.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains This PR narrowly addresses a confirmed current-main Doctor side effect; no superseding fix was identified and no introduced correctness defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor inspects plugin tool schemas using temporary local state; Workboard registration supplies tool factories backed by its existing database 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 database worker]
F --> G[SQLite or PostgreSQL store]
Technical reviewBest possible solution: Keep discovery free of durable initialization while opening the existing worker on first database use and preserving normal Gateway startup and cleanup. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the reported path from temporary inspection state to eager PostgreSQL initialization, and the linked report supplies isolated CLI results; this read-only review executed no target code. Is this the best way to solve the issue? Deferring initialization at the existing Workboard persistence owner is the smallest complete fix: discovery remains usable, actual tools retain persistence, and no parallel store or global inspection policy is introduced. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a548e97016f0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +6, Tests +52. Total +58 across 4 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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:16 PM ET / 19:16 UTC. |
…ard schemas (#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 #182771. Supersedes #182790. Thanks @etzelm. Co-authored-by: Mitchell Etzel <[email protected]>
…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]>
Closes #182771
What Problem This Solves
Fixes: every
openclaw doctor --lintrun leaves a new, empty<prefix>_workboard_<hex>schema in PostgreSQL when the Workboard store is on PostgreSQL.User Impact
User impact:
doctor --lintno longer creates Workboard database objects, so repeated lint runs (including from update wrappers) stop piling up orphan schemas. Workboard tools still work in standalone tool serving; the store opens on the first tool call. This PR does not clean up orphan schemas that already exist.Why This Change Was Made
The lint tool-schema check registers plugins in tool-discovery mode against a private temp state dir. Workboard opened its durable store eagerly at registration. With no engine anchor in the temp dir, that minted a new anchor and ran
CREATE SCHEMAplus the full table bootstrap. In tool-discovery mode the store is now opened lazily, on the first real store operation. Full (Gateway) mode still opens eagerly as before. Tool discovery is also used by standalone tool serving, where tools execute, so skipping the store entirely in that mode was not an option.Evidence
New regression test in
extensions/workboard/index.lifecycle.test.ts(real SQLite store in a temp state dir, no mocks, no PostgreSQL). It registers Workboard in tool-discovery mode, builds every workboard tool from the factories, releases the runtime like lint does, and asserts that noplugins/workboard/workboard.sqlitewas created. A second registration then runsworkboard_listand asserts that it succeeds and creates the store.On
main(fix reverted, test kept):With this change:
Also passing:
index.test.ts,src/tools.test.ts,src/sqlite-store.lifecycle.test.ts,src/sqlite-store.recovery.test.ts,src/store-lifecycle.test.tsandsrc/change-events.test.ts.src/postgres-store.test.tswas skipped locally because it needs a database. Format, oxlint and typecheck are clean for the touched files.Gap: I did not re-run the PostgreSQL
doctor --lintschema-count repro from the issue against this branch. The schema is created by the same eager worker open that the test covers for SQLite, and the PostgreSQL path goes through the sameopenEngineWorkerStorecall.