Skip to content

fix(workboard): release owner slots held by completed legacy executions - #187880

Merged
obviyus merged 4 commits into
openclaw:mainfrom
atomicdjt:fix/workboard-done-execution-owner-slot-122911
Oct 29, 2026
Merged

obviyus merged 4 commits into
openclaw:mainfrom
atomicdjt:fix/workboard-done-execution-owner-slot-122911

Conversation

@atomicdjt

@atomicdjt atomicdjt commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Related: #122911.

What Problem This Solves

A completed Workboard card can retain a historical execution marked running. That stale execution incorrectly occupies the assigned worker’s global owner slot, so ready work on another board silently never starts.

User Impact

Completed cards no longer starve later work for the same owner. Nonterminal running executions still block that owner; archived-card and expired-claim grace behavior keep their existing rules. Historical rows remain intact.

Why This Change Was Made

Move the existing done-card exclusion around all arms of the one private owner-slot predicate used by dispatcher selection and atomic SQLite admission. No duplicate SQL rule, row rewrite, migration, cap, permissions, schema, or SDK change. Keeps atomicdjt/David Turner’s contributor commits.

Evidence

Final head 74364685305f43e196067ce10a863b3dcfed5913 changes tests only from the proven production repair.

Built Gateway, real bundled Workboard RPC/CLI, actual SQLite worker and worker sessions, deterministic local provider. Legal done/running legacy records seeded through cards.create. Main twice starts no same-owner work on another board; candidate twice starts one actual worker and accepts workboard_complete, reaching done with passed proof. Normal dispatch succeeds on both; nonterminal running executions remain blocking on both. Entire old card readback is unchanged.

Detailed actual RPC/worker receipts: #187880 (comment)

Corrected existing SQLite capacity table retains a completed-positive and nonterminal-negative case. Candidate capacity + dispatcher files pass 56/56; corrected completed case fails as intended on frozen main (15 other cases pass). Focused formatting passes. Removed duplicate new helper/dispatcher test blocks; whole-PR tests net -3 lines, no allocations. Production +2/-3.

Merge danger: two-way door. Revert restores prior slot admission without rewriting stored cards. Blast radius: global Workboard owner capacity when a terminal card retains a historical running execution; live/nonterminal ownership protection remains unchanged.

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added plugin: workboard size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Oct 29, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Exclude completed cards from Workboard owner-slot occupancy even when their historical execution remains running.

Example: worker1 has a done card with a historical running execution and a ready card on another board.

  • Before: Dispatch starts zero workers because the completed card still occupies worker1’s slot.
  • After: Dispatch starts the ready card while leaving the completed card’s stored history unchanged.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused shared-owner repair with shipped-path differential proof, preserved-state verification, and a corrected base-failing regression; workflow checks still govern landing.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied exact-head built-Gateway differential exercises public Workboard creation and shipped CLI dispatch through the actual SQLite worker and worker sessions, showing successful same-owner dispatch and completion, unchanged legacy records, and continued rejection for nonterminal running work.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Ready work silently never starts because an already-completed card retains a historical running execution.
Reason: The canonical report, current source, and supplied differential establish a real failure that the narrow shared-owner change resolves without new configuration or persisted-state rewrites.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR narrowly fixes a current Workboard dispatch bug, resolves the previous regression-test finding, and supplies relevant shipped-entry-point proof; existing CI gates remain unresolved.

Priority: P1
Reviewed head: 74364685305f43e196067ce10a863b3dcfed5913

Before merge

None.

Findings

None.

Agent review details

How this fits together

Workboard’s shared capacity predicate consumes persisted card, execution, and claim state and informs both dispatcher selection and atomic database claim admission.

flowchart LR
  A[Persisted cards] --> B[Shared owner-slot predicate]
  B --> C[Dispatcher selection]
  B --> D[Atomic claim admission]
  C --> D
  D --> E[Worker session]
  E --> F[Card completion]
Loading

Technical review

Best possible solution:

Merge the shared capacity correction with its existing database regression once the normal exact-head gates pass.

Do we have a high-confidence way to reproduce the issue?

Current-main source establishes the failure at both capacity boundaries, corroborated by the supplied main/candidate Gateway differential; this review executed no target code.

Is this the best way to solve the issue?

This is the smallest complete fix for legacy completed-card starvation: correct the existing shared occupancy owner while retaining nonterminal protection and the separate terminal-transition settlement.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 548649e1dc47.

Provenance checked

  • Shared owner-slot occupancy changes intended behavior with a stated reason (549e634: The shared predicate supported durable atomic per-owner admission in fix(workboard): prevent orphaned runs and overwritten cards #125951; later work preserved shared owner policy while reducing claim reads. Scoped pickaxe history encountered unavailable older blobs, so original introduction of the earlier dispatcher condition remains unverified.)
  • Database capacity regression matrix keeps the original intent (36201c8: The capacity suite protected database admission after claim-read optimization, and test: remove low-value tests (batch d537) #183619 consolidated its fixtures; this PR preserves that boundary coverage while correcting the obsolete completed-card expectation.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 549e634 adds extensions/workboard/src/store-constants.ts:38 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 549e6349f857; files: extensions/workboard/src/store-constants.ts)
  • jondihaynes: Raw commit a88d599 adds extensions/workboard/src/store-status-write.ts:116 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: a88d599bcc51; files: extensions/workboard/src/store-status-write.ts)

PR surface

Source -1, Tests -3. Total -4 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 3 -1
Tests 1 13 16 -3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 15 19 -4

Review metrics

Metric Value Why it matters
Production versus test LOC Production +2/-3; tests +13/-16 The repair stays in the existing shared predicate and consolidates the regression into the existing capacity matrix.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #122911
Summary: This PR repairs the canonical issue’s remaining legacy completed-execution capacity failure.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: A completed legacy execution can indefinitely and silently prevent the same agent’s later Workboard tasks from starting across boards.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-29T20:33:03.710Z sha 43c1b1a :: needs real behavior proof before merge. :: [P2] Update the SQLite capacity regression for completed executions

Reviewed October 29, 2026, 5:41 PM ET / 21:41 UTC (Revision 2).

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Built Gateway / real Workboard dispatch differential

Final head 74364685305f43e196067ce10a863b3dcfed5913; frozen main 1dca2e5bcb91d3d42895112f78a7a2d325b95e84. Production is unchanged from contributor head 43c1b1ace5a4112f15d8835769a66f6446cb6c7f; the final follow-up only consolidates/fixes tests.

Secretless Node 24.22.1 Docker builds of Gateway with bundled Workboard, real SQLite worker, actual worker sessions and a deterministic local Chat Completions provider. Task-owned p187880base / p187880cand profiles, state and configs. Actual Workboard database paths are /state187880/base-proof/state/plugins/workboard/workboard.sqlite and /state187880/candidate-proof/state/plugins/workboard/workboard.sqlite; both are task-created, not any live OpenClaw state. No private-store call, SQL injection, mocked dispatcher, fake subagent.run, or direct database edit.

For each of two independent owners per snapshot, create boards through workboard.boards.upsert, then seed the legal legacy shape through actual workboard.cards.create RPC: card status:done, assigned owner worker1/worker2, execution {kind:agent-session,mode:autonomous,status:running,startedAt:1,updatedAt:1}. This is a task-owned synthetic legacy record with no current live run/session association, not a mangled live execution. Create a fresh same-owner ready card on a different board.

Run the shipped CLI openclaw --profile <task-profile> workboard dispatch --board <ready-board> --admin --url <task-loopback-Gateway> --token <synthetic-token> --json. Explicit Gateway URL/token prevents the CLI’s offline local fallback; the driver rejects gatewayUnavailable.

Scenario Main repeat 1 / 2 Candidate repeat 1 / 2
done card + legacy running execution on another board 0 / 0 started, no startFailures, new card remains ready 1 / 1 started, actual worker session/run accepted
normal ready card, separate available owner 1 / 1 started 1 / 1 started
nonterminal review card + running execution, same owner on another board 0 / 0 started, ready remains ready 0 / 0 started, ready remains ready

Every started case reaches the real provider three times: tool_search discovers workboard_complete, dispatch_action invokes that real scoped tool using the worker’s actual claim, then final assistant reply is DISPATCH_PROOF_OK. agent.wait is ok; the new card reaches done with an actual passed Workboard proof. Thus this proves dispatch, atomic claim, worker/model entry, and accepted completion—not only candidate selection or a synthetic started response.

Before/after workboard.cards.list readback compares the entire legacy card JSON exactly equal. In both candidate repetitions the old card stays done and its original execution stays running with the same id/timestamps; the repair does not rewrite that historical row. No migration, cap, reclaim grace, archive or permissions change.

Corrected SQLite regression and zero test growth

The existing capacity matrix now expects updated for a completed/running execution and separately requires owner_busy for a nonterminal/running execution. The other-claim-owner case remains. Folded these into the existing table and removed the duplicate helper-only and separate new dispatcher cases; real dispatch is independently proven above. Whole-PR tests net -3 lines (+13/-16), no new files or allocations. Production +2/-3, only the existing shared private predicate serving dispatcher and SQLite admission.

Focused secretless Docker checks:

  • Formatting check passed for predicate, capacity file and dispatcher file.
  • Candidate SQLite capacity + dispatcher files: 56/56 pass.
  • Same corrected capacity file on frozen main production: 1 intended failure / 15 pass; completed execution returns owner_busy instead of updated. Nonterminal and another-owner controls pass.

The initial harness attempt exposed the CLI’s redacted cardId result shape and deferred tool-discovery surface; those setup receipts are retained separately and not counted in the completed two-repeat matrix. Final runs used fresh task state and actual supported tool_search/dispatch_action. Full raw RPC/provider/worker receipts retained; claim tokens are not included in this public summary.

Revert fully restores prior admission behavior without data migration. Blast radius: global Workboard owner capacity for terminal cards with historical running executions. Existing live/nonterminal work remains protected.

@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@obviyus
obviyus merged commit f421bd2 into openclaw:main Oct 29, 2026
132 of 134 checks passed
@obviyus

obviyus commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Landed in f421bd2. Thanks @atomicdjt. Leftover executions on done cards no longer block new Workboard dispatch.

github-actions Bot pushed a commit to u2022Ljw/openclaw that referenced this pull request Oct 29, 2026
…ns (#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw/openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Pauline20bPauline20b5207/openclaw that referenced this pull request Oct 29, 2026
…ns (#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw/openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to jperejil8047/openclaw that referenced this pull request Oct 29, 2026
…ns (#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw/openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to HasmukhJain1414HasmukhJain141433/openclaw that referenced this pull request Oct 29, 2026
…ns (#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw/openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to NehaChoudhary6NehaChoudhary69104/openclaw that referenced this pull request Oct 29, 2026
…ns (#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw/openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 30, 2026
…ns (openclaw#187880)

fix(workboard): don't let a done card's leftover running execution block new dispatch

A card marked done could still have a legacy execution recorded as running, and Workboard counted it against the owner's global slot. No new work was dispatched to that owner on any board. The shared predicate used by the dispatcher and the SQLite claim now ignores running executions on completed cards. Real non-terminal running executions still block, and stored rows aren't rewritten.

Evidence: built Gateway with the bundled Workboard CLI and RPC, a real SQLite worker and worker sessions, with legacy done-but-running cards seeded through real RPCs. On main nothing was dispatched and fresh cards for the same owner stayed ready (twice); with this change one card was dispatched and completed with passing proof (twice). The legacy card read back exactly unchanged. Normal dispatch works on both refs, and non-terminal running executions still block on both. Details: openclaw#187880 (comment).

Thanks @atomicdjt.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P1 High-priority user-facing bug, regression, or broken workflow. plugin: workboard proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants