Repository navigation
fix(workboard): keep CLI changes visible to the running Gateway - #168457
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 changesWorkboard CLI commands use the running Gateway’s store or acquire exclusive offline ownership before opening SQLite. Example: Run openclaw workboard create "Routed card" after the Gateway has cached an empty board.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it repairs a current Workboard ownership defect, and the previous lifecycle finding is resolved without a new actionable patch defect established. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe optional Workboard plugin receives CLI and Gateway operations, persists cards through worker-backed SQLite, and returns board snapshots or worker-dispatch results. flowchart TD
CLI[Workboard CLI] --> Owner[Local state owner]
Owner --> Gateway[Gateway RPC]
Owner --> Offline[Exclusive offline custody]
Gateway --> Store[Workboard store]
Offline --> Store
Store --> SQLite[SQLite worker]
Gateway --> Workers[Subagent workers]
Technical reviewBest possible solution: Keep Workboard operations with the live Gateway and use exclusive offline custody only after its ownership has released. Do we have a high-confidence way to reproduce the issue? Current-main source exposes separate CLI writes beside writer-invalidated resident caches, and the body reports a baseline-failing warmed-read regression; this review ran no target code. Is this the best way to solve the issue? Reusing the canonical state owner fixes the producer boundary, preserves explicit remote dispatch, and avoids replaying uncertain mutations. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f694a7e6821e. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: No concrete authorization bypass was established, but the material authority boundary still needs final-effect validation. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +117, Tests +343, Docs +12, Config +4, Other +3. Total +479 across 19 files. Added test files: 2. 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 HistoryReviewed October 10, 2026, 10:42 AM ET / 14:42 UTC (Revision 3). |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…claw#168457) * feat(plugin-sdk): expose local state owner routing for CLI commands * fix(workboard): route CLI mutations through the active Gateway * fix(workboard): preserve dispatch without explicit parameters * fix(plugin-sdk): type and account for the CLI ownership surface * test(workboard): preserve state owner module exports * test(workboard): prune the retired config mock allowance * test(workboard): load plugin owners through public test surfaces * test(workboard): type owner routing fixtures precisely * test(workboard): type the facade export as a standalone function * fix(workboard): report empty worker results for offline dispatch * test(workboard): exercise Gateway lifecycle through RPC
What Problem This Solves
Fixes stale Workboard results when a separate CLI process creates, moves, or dispatches cards while the Gateway owns the database.
User Impact
Local Workboard commands use the live Gateway's existing store and immediately expose committed changes to its next read. With the Gateway stopped, the same commands work under exclusive offline ownership. Delivery failures are never replayed locally. Offline dispatch JSON now explicitly reports empty
startedandstartFailureslists while retaininggatewayUnavailable: trueand the existing text output. Existing explicit remote dispatch options, timeout, scopes, and final-response behavior remain supported.Why This Change Was Made
The CLI reused a direct SQLite store despite the Gateway owning cache invalidation. It now reuses the canonical
runWithLocalStateOwnerboundary through a narrow documented SDK subpath. Distinct.ownerRPC methods prevent an older independently installed Workboard plugin from appearing to support owner routing just because its core Gateway is new. Legacy RPC names remain supported. Implicit local list/create/move request admin to preserve their former filesystem and unrestricted-workspace authority; the owner RPCs retain legacy read/write scopes, while dispatch retains its shipped scope choices. Improving local CLI usability with restricted tokens is a follow-up.Store creation is deferred until the offline owner callback. Move preserves its expected-update predicate. Gateway create, move, and dispatch use existing commit-authority guards at new-effect boundaries; accepted launch settlement and failure compensation retain their existing independent lifecycle. No schema, retention, durability, or permission semantics change.
The SDK adds one subpath and four existing-owner function exports; the exact surface budgets account for those additions. The sole main integration is pinned to
ff06ae699514: resolving the shared budget conflict preserves main's three session-entry functions plus these four additions (152 entrypoints, 3648 exports, 2118 callable exports). Production source: +241/-124; tests and shared fixtures: +356/-9; docs/package/check metadata: +38/-10. The generated mock allowance baseline shrinks by one retired factory. The shared fixture exercises the real physical owner lock and SQLite writers, with only the cross-process transport boundary simulated.Evidence
pnpm test src/cli/workboard-owner.test.ts extensions/workboard/src/cli.test.ts --maxWorkers=1on1e2c76b3a3e8, which contains exact parent3c0ab3d0ee7b. Command wall time was 102.94 seconds; summed reported test durations were 6.663 seconds for the five owner cases and 8.781 seconds for the nineteen CLI cases. The owner cases cover warmed next-read visibility, no replay, revoked authority, accepted/rejected launch settlement, metadata admission, and offline commands.prepared. The candidate settles them asaccepted/failedwhile later work remains unstarted.ff06ae699514failed at the intended assertion: the warmed Gateway list remained empty after CLI creation. The candidate passes the same flow. The extended offline assertion also failed on the missing worker-result lists before producer normalization, then passed with accurate empty lists.c0c38840697d; the remaining seventeen graphs and scripts passed ond25682aed604; extension projects and the final root graph passed on1e2c76b3a3e8. The other three root graphs passed ond25682aed604, and the changed CLI test graph was rechecked on the final head (2.4 seconds). Earlier owned failures were repaired, rather than reported as inherited. The final production delta normalizes the offline Workboard result; subsequent test-only changes do not invalidate the reused graphs.session-incognito-history.worker.ts,server-http.ts,message-tool-execution.ts,subagent-registry-restore.ts,model-catalog-decisions.ts,prepared-model-runtime.full-catalog.ts,session-cold-storage.ts,session-entry-read-runtime.ts,session-transcript-worker-runtime.ts,session-transcript-worker.types.ts, andopenclaw-agent-db-schema.ts. Their blobs are identical to pinned baseff06ae699514; no overall full-lint pass is claimed.OPENCLAW_PITCH. Main fixes it in060b20e595f36; this change adds no environment names or budget allowance. All remaining canonical plan commands were executed separately. Formatting, assertion safety, mock-export and timeout-race checks, dependency/config/SDK boundary checks, Doctor contracts, script/database/media/sidecar guards, coercion/deprecated-API checks and import-cycle checks passed. The touched Workboard page also passed MDX validation.3b7bd1fda1b0and reused for unchanged production exports, import topology and SQLite access. Full build passed on combined head2558c6fea23e(206.26 seconds, Testbox); SDK API diff passed there (393.49 seconds): one subpath / four exports added, no removed or modified direct declarations, and 148 reachable capture-runtime/method-tuple declaration changes. Later changes preserve those exported signatures and are covered by the completed current type stages; no current-head full-build run is claimed..github/actions/setup-release-harness/narrow-lockfile.mjs,src/infra/sqlite-source-fence-admission.ts, and exportedPUBLIC_SESSION_ENTRY_SCRIPT. All three files are byte-identical to the pinned base. The separate all-exports phase passed (69.13 seconds), as did the script and full-tree export scans. No overall Knip pass is claimed.47c8225b55a17through Testbox run 38061798619. Published2026.9.9updated to the exact candidate tree, finished successfully withreadyz=200, and preserved durable/incognito state. Remote command wall time: 586.599 seconds. No schema changes.Landing verification
The lander merged main for the documentation conflict and a landed CI baseline repair, and updated the Workboard lifecycle test to exercise captured Gateway RPC handlers. Its six cases pass (220.30 seconds runner / 265.36 seconds command); an isolated review of that test-only repair found no P0/P1 issues. The final-head Workboard CI shard also passes.
CI run 38059523684, attempt 1, remains red only for independently reproduced main failures: cron delivery awareness (one case), memory reindex retry (two cases), and Agents API retry history (three cases). All six fail identically on clean main
2f968aa9fe703in unchanged owner inputs. The complete run has no cancelled jobs or other failing test jobs. Landing uses the explicitly authorized native inherited-failure admin exception; no overall CI pass is claimed.Shared SQL census context; these CLI branches were not the measured candidate
The shared six-run alternating census compared base
427f926e7c2dwith devices/backup candidate13959252b2d6. Workboard and proxy capture were not in that candidate. Each value is a phase median [min–max]; warmed values are per turn (10 warmed turns per run). Requests count all worker requests. MAIN counts are included without treating movement to another thread as a saving.The raw first-turn and warmed SQL gate did not pass in this census. Excess attribution is indeterminate; this is not a claim that all increases are noise or background work. No statement or request reduction is claimed for this PR. The new owner discovery runs only when a Workboard CLI command invokes
runWithLocalStateOwner; Gateway registration adds handler names, and ordinary Workboard reads/writes continue through the existing store. No new SQL statement or worker request is introduced on the ordinary chat-turn path. Per-operation Workboard CLI statement/request totals were not measured; the boundary tests prove routing, visibility, and settlement, not a call-count reduction. The separate follow-up observations and their limitations are recorded below.Separate remote follow-up observations; neither measured these CLI branches
The designated Hetzner follow-up and the independently retained Testbox follow-up are separate one-pair observations for the devices/backups work. They are not pooled with each other or with the initial six-run census, and neither measured this Workboard or proxy branch.
The Testbox pair compared
427f926e7c2d763e362f59678c6486b6f2f4aec4with devices/backups candidateb2825e4bebc51e76b62b539daf275d50e212182c. Total wall time was 41.840 → 41.774 seconds. Each phase cell below is a one-sample median [min–max]; warmed SQL and requests are per turn across ten warmed turns, while warmed duration covers that whole window.The retained Testbox observation has unchanged warmed MAIN SQL (7.8/turn) and worker requests (195/turn), with all-thread warmed SQL 1023.9 → 1023.4. Its first-turn change is 1813 → 1816 statements, MAIN stays 59, and worker requests fall 264 → 263. Count reconciliation is complete: first-turn SQL is existing admission trios (+6), config-machine reads (+3), exact-entry reads (−1), and catalog reads (−5), net +3. Whole-workload varying operations sum to +7 statements; the only extra requests are session-row-facts (+1) and sessionRows.sharedFacts (+1). Every named varying caller is byte-identical and no retained native SQL stack names changed operational source. Unknown caller labels and unavailable event-level async origins remain explicit limits; the retained Testbox vectors cannot recover the lost Hetzner vectors.
The designated whole-workload observation is lower; the independent Testbox observation is slightly higher. Under the campaign's updated RAW TURN INCREASE and TARGETS ARE AIMS disposition, there is no confirmed PR-caused regression. This is not a claim that the independent Testbox totals decreased, nor a reconstruction of missing attribution. No statement or request saving is claimed for either CLI branch, and their per-operation CLI totals remain unmeasured.