Repository navigation
fix(workboard): prevent orphaned runs and overwritten cards - #125951
Conversation
Persist launch intent before worker acceptance, reconcile accepted identities, fence cross-host card mutations, and deduplicate session capture in SQLite. Closes #125932
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 18, 2026, 3:55 PM ET / 19:55 UTC. ClawSweeper reviewWhat this changesThis PR moves Workboard launch and card concurrency handling to Gateway and SQLite, adds conditional UI edits, and returns the accepted session identity from Gateway-backed subagent runs. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked by patch quality or review findings - 7 items remain Keep open: both prior race findings remain on the current head, so the PR still permits an old lifecycle event to terminalize a newer run and can reject a concurrent archived-session restore. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherWorkboard turns dashboard cards into worker runs and persists their lifecycle in SQLite. Control UI and scheduled dispatch enter through Gateway methods, which launch workers and update cards for operators. flowchart LR
UI[Control UI] --> Gateway[Gateway workboard methods]
Scheduler[Scheduled dispatch] --> Admission[Launch admission]
Gateway --> Store[SQLite card store]
Admission --> Store
Admission --> Worker[Subagent run]
Worker --> Lifecycle[Lifecycle events]
Lifecycle --> Store
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +560, Tests +428, Docs +2. Total +990 across 35 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Centralize both outcomes at the durable owner: fence all terminal lifecycle effects by the current association, and reread the deterministic archived-capture winner after a CAS loss. Do we have a high-confidence way to reproduce the issue? Yes—source inspection establishes deterministic interleavings for both failures, although this read-only review did not execute the suites. Is this the best way to solve the issue? No—the durable-boundary direction is sound, but the two remaining CAS/lifecycle paths leave the reported invariant incomplete. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6f8e5d907815. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Use a plugin-local synchronization helper and update the sessions-page capture expectation for the new store-owned RPC.
Apply terminal lifecycle state only while the matched association is current, and converge concurrent archived session restores on the active winner.
|
Land-ready evidence for #125951 at exact head a512a604e9ef43066091079094468db913a76d5b. CI is green at the exact head: run 32182979407. The native agent prepare completed successfully with Focused final proof after the review fixes:
Earlier complete proof also passed: CI history was investigated rather than bypassed. Initial exact-head predecessor run 32172015619 exposed attributable extension-boundary and sessions-page stale-expectation failures; those product/test integration gaps were fixed in 4e366457fe1b536cd6e8ca97cc9f7b7b2ef5cff2. Run 32178613502 then hit an ClawSweeper's P1 lifecycle-association fence and P2 archived-capture convergence findings were both applied in the exact head. The regression coverage now proves stale terminal events cannot close replacement runs and concurrent archived restorations converge on the durable active winner. No rank-up move was skipped. Judged LOC against the merge base: production +988/-422 (net +566), tests +919/-460, docs +7/-5. The production growth is justified by moving launch, lifecycle association, conditional edits, and cross-host capture ownership into the Gateway/SQLite boundary while removing the browser-owned launch path. Best-fix verdict: best. The repair records accepted identity at its producer and serializes mutable state at the durable Gateway/SQLite owner. A downstream retry would still permit an accepted worker to become orphaned; browser-local dedupe cannot coordinate multiple Gateway hosts; and retaining browser-owned launch would preserve the split ownership that caused the races. Known proof gap: the Gateway ownership races are proven with a mocked Gateway and two-connection SQLite coverage, not an authenticated live multi-process Gateway deployment. The exact-head CI, owner-boundary race suites, Gateway tests, and real Chromium UI flow cover the deterministic contract without representing that substitute as authenticated live proof. |
|
Merged via squash.
|
…#125951) * fix(workboard): make ownership updates atomic Persist launch intent before worker acceptance, reconcile accepted identities, fence cross-host card mutations, and deduplicate session capture in SQLite. Closes openclaw#125932 * test(workboard): keep race fixtures plugin-local Use a plugin-local synchronization helper and update the sessions-page capture expectation for the new store-owned RPC. * fix(workboard): fence lifecycle and restore races Apply terminal lifecycle state only while the matched association is current, and converge concurrent archived session restores on the active winner.
Closes #125932
What Problem This Solves
Fixes an issue where Workboard operators could see accepted worker runs reported as failed, lose concurrent card moves or lifecycle updates when saving an older editor draft, or capture duplicate cards for one dashboard session when multiple Control UI or Gateway hosts acted concurrently.
Why This Change Was Made
The repair moves ownership to durable boundaries instead of compensating in the browser:
No SQLite schema, migration, or Gateway protocol-version change is required. The PluginRuntime addition is backward-compatible: Gateway-backed subagent runs now return the canonical accepted
sessionKey, while custom runtimes may omit it.This PR is AI-assisted. The implementation, tests, runtime contracts, and final diff were reviewed directly by the maintainer.
User Impact
Workboard now gives operators a consistent outcome under concurrent or partially failing operations:
Evidence
Visual proof
Before: Workboard card before opening the editor.
After: the real Control UI editor running against the deterministic mocked Gateway fixture.
workboard-edit-flow.mp4
Focused proof
node scripts/run-vitest.mjs extensions/workboard/src/store.test.ts --reporter=dot— 129 passednode scripts/run-vitest.mjs src/gateway/server-plugins.test.ts --reporter=dot— 72 passedpnpm docs:listandpnpm docs:check-mdxpassedpnpm check:changedpassedpnpm buildpassedChange size
Production LOC: +988/-422 (net +566) | Tests: +919/-460 | Docs: +7/-5
The production growth is the durable concurrency boundary: transactional cross-host claims and capture, canonical accepted-run recovery, revision-fenced store writes, structured conflict propagation, and the UI rebase flow. The previous browser-owned autonomous launch choreography was deleted, and shared SQLite transaction and owner-capacity policy were reused to keep the repair coherent.