Repository navigation
feat(workboard): run attached automations after linked sessions finish - #125170
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 5:24 AM ET / 09:24 UTC. ClawSweeper reviewWhat this changesThe PR makes Workboard run an attached enabled automation immediately after a linked agent or subagent session ends. Merge readinessKeep open for maintainer review: current main lacks the event nudge, while the PR’s latest head addresses the prior disabled-automation blocker with enabled-state checks before cron admission. Priority: P1 Review scores
Verification
How this fits togetherWorkboard records cards linked to agent sessions and optionally to an operator-owned automation. Terminal session hooks update the card, then this change asks Cron to admit the attached automation without overriding disabled or auto-disabled jobs. flowchart LR
A[Linked agent session] --> B[Workboard terminal hook]
B --> C[Card lifecycle update]
B --> D[Board automation nudge]
D --> E[Enabled-only cron admission]
E --> F{Automation enabled?}
F -->|Yes| G[Queued automation run]
F -->|No| H[Skipped result and preserved schedule]
Decision needed
Why: This is a public Gateway protocol expansion, so code review cannot determine the intended long-term contract alone. Before merge
Agent review detailsSecurityNone. PR surfaceSource +231, Tests +433, Docs +6. Total +670 across 19 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:
Technical reviewBest possible solution: Retain one generic Cron-owned enabled-only immediate admission path and use it from Workboard rather than adding a Workboard-specific execution bypass. Do we have a high-confidence way to reproduce the issue? Yes—current-main source shows terminal lifecycle updates without any automation nudge, while the PR’s focused tests define the affected linked-session path; this review did not execute it in the read-only environment. Is this the best way to solve the issue? Yes—the generic Cron admission is the narrowest maintainable solution because it preserves disablement, auto-disablement, concurrency, and scheduled-run ownership instead of duplicating them in Workboard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b77671ced26f. 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 (2 earlier review cycles)
|
286367d to
a9477c3
Compare
a9477c3 to
e2c6fb1
Compare
|
Addressed the P1 and every listed rank-up move on
Focused proof includes 20 cron admission tests, 30 protocol validator tests, 42 Workboard lifecycle tests, the real Gateway boundary, the isolated Workboard E2E, |
|
Maintainer decision: accept the additive generic Exact-head required CI run |
|
Merged via squash.
|
openclaw#125170) * feat(workboard): nudge attached automations on session events * fix(workboard): share automation nudge lifecycle state * fix(workboard): satisfy nudge type guards * fix(cron): add enabled-only immediate runs
What Problem This Solves
Fixes an issue where a Workboard board with an attached automation still waited for the automation's next schedule after a linked agent or subagent finished. The card lifecycle update reached
review, but the categorization automation was not nudged from the prepared model generation that emitted the terminal hook.Series context: #125023, #125076, #125094.
Why This Change Was Made
Workboard now requests the board's operator-owned automation with the additive
cron.runmodeif-enabledwhen a matching linked session ends, with one process-wide lifecycle owner and a 60-second per-board debounce. Cron rechecks the authoritative enabled and auto-disabled state under its reservation lock before immediate admission. Prepared model generations register fresh hook closures without starting plugin services, so the active service logger, lifecycle fence, and debounce map are shared through the plugin SDK process singleton. Explicit operatorforcesemantics are unchanged, cron-originated sessions remain excluded to prevent self-triggering, and the stored schedule remains the backstop.User Impact
Operators can attach an enabled automation to a Workboard board and have it react immediately when linked work finishes. Disabled and auto-disabled jobs are skipped with a typed non-error result; repeated events for the same board coalesce, failures and skips remain non-blocking for card lifecycle updates, and successful requests now leave an attributable log line with the returned automation run ID.
Evidence
Boundary regression proof:
src/gateway/server.cron.test.tscreates real far-future enabled and disabled cron rows and dispatchescron.runwithmode: "if-enabled"through a bundled-plugin runtime request carrying an ambient foreign agent identity. It proves the trusted synthetic admin client reaches the real method router, runs the enabled row, and returnsreason: "disabled"without history for the disabled row.src/cron/service/ops.run-admission.test.tsproves enabled, disabled, auto-disabled, and disable-after-enqueue behavior under cron's authoritative reservation and activation locks. Existingforcecoverage remains unchanged and still admits explicitly forced disabled jobs.test/e2e/qa-lab/runtime/managed-worktrees-workboard-lifecycle-product-proof.e2e.test.tsfailed before the owner repair with the card atreviewand zero automation history; it passes after the repair through a real isolated Gateway, Workboard service/hook, persisted board/job, and mock provider.src/plugins/runtime/generation-scope.ts:18-45carries the prepared registry,src/plugins/hook-runner-global-state.ts:124-127selects it for hook dispatch, andextensions/workboard/src/automation-nudge.ts:30-52now bridges those hook closures to the active service owner.Focused exact-head checks:
node scripts/run-vitest.mjs extensions/workboard/src/lifecycle-sync.test.ts— 41 passed.node scripts/run-vitest.mjs src/gateway/server.cron.test.ts -t 'bundled plugin runtime runs enabled automations and skips disabled ones'— 1 passed.node scripts/run-vitest.mjs src/cron/service/ops.run-admission.test.ts— 20 passed.pnpm protocol:check— passed; additive schema member, no protocol version bump, Swift unchanged.OPENCLAW_BUILD_PRIVATE_QA=1 node scripts/run-vitest.mjs test/e2e/qa-lab/runtime/managed-worktrees-workboard-lifecycle-product-proof.e2e.test.ts -t 'nudges a persisted future automation when a linked worker ends'— 1 passed.origin/main— clean, no accepted/actionable findings.Live isolated Gateway proof used
openai/gpt-5.6-luna. Job98fda088-8468-45a0-b82d-998074f3e90ehad schedule0 3 1 1 *inAmerica/Los_Angeles, exact, with its next due time at2027-01-01T11:00:00Z(Next in 137din the recorded UI). It started from the event nudge at2026-08-17T01:10:13.413-07:00, finishedokin 6.360 seconds, and movedRough customer follow-upfromtriagetotodo. The linked card reachedreview.Gateway log correlation:
History verdict:
The recorder's extra Automations-page text locator timed out after the mandated assertions passed. The final video frame visibly shows the Run history tab with
Peter tasks event clarifier · OK,gpt-5.6-luna,Run at 1:10:13 AM,Next in 137d, and the successful move summary; coordinator review accepted the live gate.workboard-event-nudge.webm