Repository navigation
fix(workboard): recover interrupted worker launches - #126170
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 19, 2026, 12:21 AM ET / 04:21 UTC. ClawSweeper reviewWhat this changesThe PR adds durable prepared, accepted, and failed launch phases to Workboard cards so restart reconciliation can recover accepted workers or visibly block launches that never reached Gateway acceptance. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep open: current main retains the missing-session no-op this PR addresses, but the prior P1 remains—an optional terminal timestamp is replaced with the reconciliation clock and can falsely adopt a never-accepted retry. Likely related people: steipete — recent Workboard launch-lifecycle owner (high confidence). Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Workboard plugin persists card state before dispatching a subagent through the Gateway. On restart, lifecycle reconciliation reads Gateway session rows and turns that evidence into the card’s visible running, review, or blocked state. flowchart LR
A[Ready Workboard card] --> B[Dispatcher prepares durable launch]
B --> C[Gateway subagent launch]
C --> D[Gateway session row]
D --> E[Restart reconciliation]
E --> F[Store-owned launch transition]
F --> G[Visible card status]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +311, Tests +482. Total +793 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the store-owned launch lifecycle, but treat a terminal session without a timestamp newer than preparation as unproven, then add the shared-store restart regression before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source: reconcile a prepared card against a complete terminal session snapshot with the same deterministic key and no Is this the best way to solve the issue? No; durable launch state is the right owner boundary, but terminal acceptance must remain unproven when its optional timestamp is absent rather than being synthesized from reconciliation time. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c3b3c6ea8d3. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
d4227ae to
4ed1057
Compare
Persist prepared, accepted, and failed launch phases so Gateway restart reconciliation cannot leave cards permanently running between launch preparation and worker acceptance.
4ed1057 to
d3355ea
Compare
Do not synthesize terminal-session acceptance timing during restart reconciliation; stale same-key terminal rows without updatedAt now fail the prepared launch instead of being adopted.
|
Land-ready evidence for #126170 at exact head 682b515837bb8a24a643ecc29620d0eeef471316. ClawSweeper disposition: the P1 terminal-evidence finding was applied. Terminal sessions no longer synthesize acceptance time when Exact proof:
CI history: the first two attempts (32213491604 and 32214072115) reused a stale merge ref and failed only on two unrelated docs/contract assertions already repaired on main. Rebasing onto current main produced a clean exact-head run before review, and the final finding-fix head is green above. Production LOC: +495/-184 (net +311) | Tests: +511/-1 (net +510). The production growth is the durable typed launch-state owner, trusted normalizer, fenced store transitions, and restart reconciliation; it adds no parallel persistence path. Known proof gap: restart behavior is proven through deterministic shared-backing-store preparation → process-loss → replacement-store ordering, not an authenticated live multi-process Gateway restart. No SQLite DDL/schema-version change, no persisted-envelope version change, and no Gateway protocol change. |
|
Merged via squash.
|
* fix(workboard): recover interrupted worker launches Persist prepared, accepted, and failed launch phases so Gateway restart reconciliation cannot leave cards permanently running between launch preparation and worker acceptance. * fix(workboard): require durable terminal evidence Do not synthesize terminal-session acceptance timing during restart reconciliation; stale same-key terminal rows without updatedAt now fail the prepared launch instead of being adopted.
Related: #125951
What Problem This Solves
Fixes an issue where Workboard cards could remain permanently running when the dispatcher or Gateway restarted after a worker launch was prepared but before worker acceptance was durably recorded.
Why This Change Was Made
The Workboard store now owns a typed, durable launch lifecycle—prepared, accepted, or failed—inside the existing
automation_jsonpayload. The dispatcher persists preparation before calling the worker runtime, records acceptance through a fenced store transition, and lets post-restart lifecycle reconciliation either adopt a session that proves acceptance or fail a missing prepared launch. Delayed failures and stale lifecycle observations are matched against the exact prepared identity so they cannot overwrite a newer retry.This replaces the prior process-local
launchIntentPersistedflag and generic execution-association enrichment with canonical store-owned transitions and a trusted launch-state normalizer. The existing SQLite schema, persisted envelope version, and Gateway protocol are unchanged.Provenance: clear — the prelaunch persistence window was introduced in #125951 on 2026-08-18 by PR author @steipete and squash-merged by @steipete as
549e6349f8579cbbaa29147dc193b3c6b76f6b99; it persisted a running association beforesubagent.runwithout a durable prepared/accepted phase that restart reconciliation could distinguish.Production LOC: +495/-184 (net +311) | Tests: +483/-1 (net +482). The positive production delta is the durable typed launch-state ownership boundary, store transitions, restart reconciliation, and trusted normalizer; it does not add a parallel persistence path.
User Impact
Workboard no longer leaves cards permanently running when the dispatcher or Gateway restarts between launch preparation and worker acceptance. Accepted workers are recovered under their canonical session, genuinely missing launches become visibly blocked, and later retries are protected from delayed failures belonging to an older launch.
Evidence
tbx_01m0bjvjbz4rmqssnx4yevjcwb: https://github.com/openclaw/openclaw/actions/runs/32196803631dispatcher-ownership.test.ts,lifecycle-sync.test.ts,lifecycle-sync.restart.test.ts, andstore.test.ts.git diff --checkpassed.check-changedaggregate was not used as final proof because it stopped on unrelated assertion-safety baseline drift inextensions/copilot/src/tool-bridge.tsandsrc/agents/embedded-agent-runner/run/attempt-prompt-support.ts. The exact selected formatting, lint, typecheck, and focused test lanes all passed.AI-assisted: implementation and review used Codex; the final diff and evidence were inspected and coordinated by the maintainer.