Repository navigation
refactor(workboard): read board snapshots and widget documents through the board worker - #164448
Conversation
Move durable dashboard snapshot and widget-document reads through the existing board worker and canonical agent broker. Preserve FIFO consumption, live routing authority, domain errors, and accepted-work close settlement; retain the excluded incognito owner.
|
🦞👀 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: blocked before merge. Reviewed October 3, 2026, 3:24 PM ET / 19:24 UTC (Revision 5). ClawSweeper reviewWhat this changesMove durable dashboard snapshots and widget-document reads into the existing board database worker while preserving read/write ordering and synchronous authorized consumption. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains The PR remains useful: current main still performs these board reads on the host. No actionable introduced defect was found, and the updated evidence addresses the previous SDK-comparison blocker. Priority: P2 Review scores
Verification
How this fits togetherBoards store session dashboards and widget content in agent SQLite databases. Gateway requests read that content for dashboard responses, widget HTTP delivery, and MCP App views. flowchart TD
A[Dashboard and widget requests] --> B[Capture session and physical store]
B --> C[Shared read and write queue]
C --> D[Existing board database worker]
D --> E[Coherent SQLite read]
E --> F[Recheck current authority]
F --> G[Consume response or widget content]
G --> H[Release publication and execution]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +153, Tests +321, Docs +5. Total +479 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one board database owner serving durable reads and writes, with current-authority checks, coherent snapshots, and joined shutdown cleanup. Do we have a high-confidence way to reproduce the issue? Yes, from source: current-main direct getters bypass the write reservation and can read before an earlier queued write commits. The PR supplies focused failing-before/passing-after evidence; this review did not execute it. Is this the best way to solve the issue? Yes. Extending the existing board worker and shared admission queue is a focused repair that preserves released asynchronous interfaces and persisted formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 48d366fbe5b5. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…h the board worker (openclaw#164448) * refactor(workboard): read snapshots and widget documents in worker Move durable dashboard snapshot and widget-document reads through the existing board worker and canonical agent broker. Preserve FIFO consumption, live routing authority, domain errors, and accepted-work close settlement; retain the excluded incognito owner. * fix(workboard): type missing board read results * style(workboard): keep the captured read target in a local binding
What Problem This Solves
Session dashboard snapshots and widget-document reads still execute board SQLite on the Gateway thread. Direct snapshot and MCP-document getters can also overtake an earlier accepted board write.
Why This Change Was Made
Add typed snapshot/document commands to the existing board worker on the canonical agent broker. Capture the physical store before yielding, read one synchronous snapshot, and retain the shared read/write FIFO through current-authority checks and synchronous consumption. Release the reservation before awaiting external consumer promises, and join publication cleanup through the existing request/database lifetimes.
Gateway grants now check the captured logical routing configuration without repeating physical-store discovery. The executor retains physical identity and database-owner validation. This also prevents cold custom/shared-store discovery from entering SQL inside a worker grant.
User Impact
Final-head released-SDK comparison completed successfully on Testbox; report details are recorded below.
Durable board.get, widget HTTP GET/HEAD, and MCP view/interaction reads use the worker. Existing incognito reads retain their process-held owner; write preflight and schema admission are outside this cutover. No new worker service, schema, persistent cache, retention, durability, permission, protocol, or update migration is introduced. Board APIs were already asynchronous in v2026.9.8; no synchronous Plugin SDK contract is removed.
Production: +215 / -62 / net +153 (277 changed lines, five files). Native inventory: T1 1,233 → 1,232 against merge base
4ab382220e2cca1deedb2c2549982f91c0fb5c64. Shared kernels remain classified T1 because incognito still uses them; this count is not a latency measurement. No new OPENCLAW_* names.Evidence
Baseline regressions observed caller-thread board SQL in board.get (4 observations), HTTP disclosure (2), and MCP view/interaction reads (7). All three direct getters returned revision 1 while an earlier queued write committed revision 2. The migrated paths now observe zero caller-thread board SQL and the committed revision.
Coverage includes transaction/commit refusal, transported BoardValidationError identity, unknown write outcomes without replay, captured state roots, external-consumer FIFO release, and the real Gateway close prelude. Shared-store RPC proof invalidates the registry memo inside grants, observes no registry/schema-owner discovery there, and refuses store-path changes without creating a successor database.
The HTTP ordering fixture now checks that the response has ended before a removal is queued. Its former socket-finish/microtask ordering assertion changed under worker continuation scheduling; the actual synchronous disclosure contract is preserved.
Validation uses
pnpm test <paths> --maxWorkers=1on the shared host:This covers 92 distinct focused cases plus 12 import/build-graph cases. Behavioral/import proof ran on
23840886b7586; later mechanical corrections type missing read results asundefinedand use a separate local binding for the captured target; read behavior is unchanged. Final core typecheck passes. Final P2 Codex autoreview is scoped-clean against the pinned merge base. Madge reports 0 cycles, and the database-worker ratchet passes.Per-file test cost (measured test bodies; grouped process wall times above)
src/boards/board-store.test.tssrc/boards/board-store.parity.test.tssrc/boards/sqlite-board-store.outcomes.test.tssrc/boards/sqlite-board-store.worker.test.tssrc/gateway/board-http.test.tssrc/gateway/board-store.test.tssrc/gateway/server-methods/board.test.tssrc/gateway/server-close.board.test.tstest/scripts/runtime-process-build-graph.test.tssrc/auto-reply/reply/get-reply.imports.test.tssrc/state/openclaw-state.worker.imports.test.tsThe real-close case must exercise actual Gateway startup, close-prelude admission fencing, accepted worker settlement, and database teardown; a direct store-disposal test does not cover that order. Existing parity tests include migrations and reopen behavior. Host load caused substantial timing variation; no sleeps, timeouts, retries, or worker pins were added to the suites. CI seconds are pending.
Released-SDK merge precondition satisfied on final head
320af4cfb9fb8d585793a136b441d7fa0ef2150aby the Testbox report below. The local v2026.9.8 comparison againstf96f823820b76installed both revisions and began declaration rendering, then exited 1 after 284.70 s withManaged command exited while its process group remained active. No JSON or Markdown comparison was produced. This is a tooling failure, not successful compatibility proof; the required Testbox comparison subsequently completed, as recorded below. No blind retry was made.node scripts/check-changed.mjs --base 4ab382220e2cca1deedb2c2549982f91c0fb5c64completed successfully on the final head, including all core/test type graphs, lint, dead-export scans, storage/import guards, and ratchets.git diff --checkpasses.Recent overlap review found no competing board SQLite migration. #164269 and #164320 are incidental cleanup; #135889/#135890 are adjacent task-lane features without board SQLite changes. #162433 is the acknowledged inactive umbrella design and is not adopted by this change.
Maintainer landing review
The final-head source review confirms that the exported
BoardStoremethods in v2026.9.8 already return promises. The renamed kernel helper is internal: nosrc/plugin-sdkexport,api.runtimesurface, or documented SDK subpath exposes it. No released signature is removed or changed, so no compatibility record is required for this cutover. The full released-SDK report has now been produced successfully, as recorded below.The generic ClawSweeper data-model warning is not supported by the patch: schema definitions and persisted board representations are unchanged, and read-only worker publications skip schema creation. ClawSweeper's detailed exact-head review independently reaches the same conclusion and reports no code findings. Existing parity proof covers migrations and reopening. The final-head worker test includes explicit queued-write/read ordering for snapshot, metadata, and MCP document getters.
The earlier PR-context job evaluated the initial body; the current authored problem/evidence body passes
evaluatePullRequestContext. Its stale failure does not describe the current PR text.CI failure attribution
CI run 37144084669 tested merge
67b3a6febf59c793abc21ddbea01dbda72b4866cwith main parentf79dac86bd4a9bb97bf99a5a69a04c603c0eeac6and the approved PR head. Its five reclamation worker-count failures are independently reproduced on that main parent and exact merge. The same cases fail in scheduled main CI. Main's #164236 adds a schema-lease heartbeat worker; the unchanged reclamation test counts every process worker and therefore sees 2/3 workers instead of 1/2. Constructor tracing identifies that heartbeat before the intended archive worker. The PR's board reads occur after the failing assertion. All 15 test/schema/worker attribution paths are unchanged between the main parent and tested merge.On Linux/Node 24.19.0 Testbox,
pnpm test src/config/sessions/session-accessor.sqlite-reclamation.test.ts --maxWorkers=1passed five times at the approved head and five times at the merge base (16 tests each, about 30–32 seconds/run). Exact main and tested-merge replays reproduced all five failures. Initial baseline setup attempts lacked workspace dependency links and failed before tests; separate frozen installs repaired that proof fixture before the five valid baseline runs. Testbox run.The cancelled UI job also had a real earlier failure: the mocked-Gateway widget sandbox test exhausted its 30-second native iframe pointer/layout readiness budget while collapsing an expanded frame (
elementHandle.hover: Timeout 1ms exceeded). It serves board data and HTML from its own fixtures and does not execute the changed board SQLite path. Its test/helper bytes are unchanged. The entire failing file passed five times on the approved head and five times on the merge base, singly with--maxWorkers=1(10 tests, 200.261 seconds total); current scheduled-main UI shards also passed. The original timeout is not reproduced, and its deeper timing cause remains uncertain. The one authorized single-job rerun passed (attempt 2 UI job); that success is not claimed as a fix. Other cancelled coverage remains unrun.Released-SDK report and final-head FIFO
plugin-sdk:api:diffcompleted with exit 0 for v2026.9.8 (release commitfc23bc864e4553c2d215e479eeec47b67a0bf943) against exact final head320af4cfb9fb8d585793a136b441d7fa0ef2150aon Blacksmith Testbox run 37146068216. Both declaration renders succeeded: 106.152 seconds for the release and 116.633 seconds for the candidate. The provenance record isopenclaw.plugin-sdk-api-release-evidence/v1, statuschecked, with both head/workflow SHA bound to the approved head.The complete JSON report is 14,179,952 bytes, SHA-256
6859a6583e6858229e3d541ff62fdcd73ec5385edbf1a47b26f6ecf58f3a5217; comparison digestc7d46b0bc9f01609c049a2947042b5040635ea76dedff6b557ca56f0108c195f. It reports 8 removed entrypoints, 1 added entrypoint, and 2,219 export changes across the broad release-to-head history. This is not a zero-difference release report. Source reachability and report inspection find no changed board-read signature in the released Plugin SDK surface; the renamed kernel helper remains internal. No new compatibility shim or acknowledgement of unrelated release changes was introduced.On the same exact-head Testbox,
pnpm test src/boards/sqlite-board-store.worker.test.ts -t 'reads the committed Board' --maxWorkers=1passed all three selected read-after-write regressions (snapshot, metadata, MCP); 16 unrelated cases were skipped by the explicit filter. Vitest wall time was 7.14 seconds; the repository wrapper took 23.53 seconds. Both task-owned Testbox leases were stopped after proof.