Fix Workboard card status persistence#88957
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the open maintainer-owned Workboard persistence PR now covers this PR's useful UI/controller changes and adds the missing persisted store-side lifecycle provenance needed for the underlying bug. Canonical path: Close this branch and continue review on #89600 as the canonical fix for #88592. So I’m closing this here and keeping the remaining discussion on #89600 and #88592. Review detailsBest possible solution: Close this branch and continue review on #89600 as the canonical fix for #88592. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main's lifecycle sync can emit a status update when linked session/task state changes, and the Workboard store currently accepts status patches without lifecycle provenance. The linked user report gives concrete Control UI edit and drag steps, but I did not run a live browser repro in this read-only review. Is this the best way to solve the issue? No. This PR is a useful partial mitigation, but the best fix is the persisted lifecycle provenance/store-side guard plus UI/view coverage represented by #89600. Security review: Security review cleared: The diff only touches Workboard UI/controller code and tests, with no dependency, workflow, credential, publishing, or code-execution surface change. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c2d7b4a486b1. |
5116e7e to
cbb0836
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses Workboard cards “bouncing” back to lifecycle-driven statuses after an explicit operator change (drag/edit), by adding a timestamp-based guard to ignore stale lifecycle updates. It also fixes the edit modal so persisted card values (status/priority/agent/session) reliably render as selected when reopening the modal.
Changes:
- Add
sourceUpdatedAtto computed lifecycle data and skip status sync when lifecycle updates are older than the card’s persistedupdatedAt. - Ensure edit-modal
<select>fields reflect draft values on re-render/reopen by explicitly selecting the matching<option>. - Add regression tests covering stale vs fresh lifecycle sync behavior for both linked sessions and linked tasks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui/src/ui/views/workboard.ts | Ensures edit modal selects render the current draft value as selected. |
| ui/src/ui/views/workboard.test.ts | Adds a regression asserting saved card values are shown when reopening the edit modal. |
| ui/src/ui/controllers/workboard.ts | Introduces sourceUpdatedAt and a staleness guard to prevent outdated lifecycle sync from overwriting newer card updates. |
| ui/src/ui/controllers/workboard.test.ts | Adds controller tests for stale/fresh lifecycle sync across edit saves, drags, reloads, and task updates. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing this as superseded by #89600 plus follow-up #90067. #89600 landed the persisted lifecycle provenance/UI/store fix for #88592, and #90067 covered the final bulk-update safety finding: stale lifecycle suppression no longer mutates a shared bulk patch. This PR was a useful partial attempt, but it used generic update freshness and did not cover persisted/store-side stale writes or the shared bulk patch isolation path. Thanks for the report/fix attempt. |
Fixes #88592
Real behavior proof
Behavior or issue addressed: Workboard linked cards could bounce away from an explicit operator status change because stale linked-session lifecycle sync rewrote the card after drag/edit saves. The follow-up fix also preserves the documented contract that fresh linked session/task lifecycle updates still move active
todo/runningcards torevieworblocked, including task payloads that do not provide a validupdatedAttimestamp.Real environment tested: local OpenClaw checkout on macOS, branch
codex/workboard-persist-running, Node 24.15.0, using the production Workboard UI controller functions fromui/src/ui/controllers/workboard.ts.Exact steps or command run after this patch: ran direct
pnpm exec tsx --evalcommands that importgetWorkboardState,moveWorkboardCard, andsyncWorkboardLifecycle; they exercise production-controller scenarios for stale/fresh session lifecycle sync, stale/fresh task lifecycle sync, and the Copilot-reviewed missing-task-timestamp case.Evidence after fix:
Observed result after fix: stale lifecycle events older than the persisted card update no longer issue
workboard.cards.update, so the explicit operator change survives reload/new-host state. Fresh completed/failed session and task lifecycle events still issue the expectedworkboard.cards.updatepatches. Task payloads without valid timestamps fall back to the previous sync behavior instead of being treated as stale.What was not tested: no live browser recording was captured; the proof exercises the real local Workboard controller path and request methods directly.
Supplemental validation
manualStatusCardIdsoverride with a timestamp-aware lifecycle guard based on persisted card update time and linked session/task update time.node scripts/run-vitest.mjs ui/src/ui/controllers/workboard.test.ts ui/src/ui/views/workboard.test.tspassed, 83 tests.node scripts/run-vitest.mjs extensions/workboard/src/store.test.ts extensions/workboard/src/gateway.test.tspassed, 75 tests.pnpm check:test-typespassed.pnpm lintpassed.pnpm run format:check -- ui/src/ui/controllers/workboard.ts ui/src/ui/controllers/workboard.test.tspassed.git diff --checkpassed.