From 02ee8a4fd5419d31d85c5163a05d0c9f4477a878 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Sat, 18 Jul 2026 13:50:58 -0700 Subject: [PATCH] fix: hide stale task-card oversight icons (#2318) ## Summary Task cards now remove the overseer eye as soon as their workflow's effective oversight becomes `off`, instead of reusing an active value cached before the setting changed. The invalidation covers card remounts as well as mounted cards, and authoritative writes from the dashboard, agents, and configuration rollback reach the board through the existing project-scoped SSE stream. Older in-flight responses cannot restore the eye after a newer `off` value wins, while unrelated workflow-setting saves leave active indicators undisturbed. ## Validation - 99 focused dashboard regression tests passed across selected and aggregate cards, desktop and mobile, SSE delivery, and out-of-order responses - Core and dashboard typechecks passed - `pnpm lint` and `pnpm check:changesets` passed - `pnpm verify:fast` passed production builds and the CLI/server boot smoke ## Summary by CodeRabbit - **Bug Fixes** - Planner-overseer eye badges now disappear immediately when workflow oversight is turned off. - Prevented stale or out-of-order updates from displaying incorrect oversight status. - Oversight indicators now remain hidden when the effective setting cannot be confirmed. - Live workflow setting changes now update task cards without requiring a page refresh. - **Documentation** - Clarified eye badge visibility rules, tooltip meaning, and active oversight states in the dashboard guide. --- .changeset/fix-task-card-overseer-cache.md | 7 ++ docs/dashboard-guide.md | 3 +- .../workflow-authoritative-reads.pg.test.ts | 13 +++ packages/core/src/store.ts | 6 + .../core/src/task-store/remaining-ops-2.ts | 19 +++- .../workflow-setting-values-events.test.ts | 57 ++++++++++ packages/dashboard/app/api/legacy.ts | 9 +- .../dashboard/app/components/TaskCard.tsx | 105 ++++++++++-------- .../__tests__/TaskCard.oversight.test.tsx | 82 +++++++++++++- .../hooks/__tests__/useBoardWorkflows.test.ts | 28 +++++ .../dashboard/app/hooks/useBoardWorkflows.ts | 8 ++ .../app/utils/workflowSettingValuesEvents.ts | 59 ++++++++++ packages/dashboard/src/__tests__/sse.test.ts | 32 ++++++ packages/dashboard/src/sse.ts | 11 ++ 14 files changed, 387 insertions(+), 52 deletions(-) create mode 100644 .changeset/fix-task-card-overseer-cache.md create mode 100644 packages/dashboard/app/api/__tests__/workflow-setting-values-events.test.ts create mode 100644 packages/dashboard/app/utils/workflowSettingValuesEvents.ts diff --git a/.changeset/fix-task-card-overseer-cache.md b/.changeset/fix-task-card-overseer-cache.md new file mode 100644 index 0000000000..65127b5d76 --- /dev/null +++ b/.changeset/fix-task-card-overseer-cache.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Hide task-card overseer eyes immediately after workflow oversight is turned off. +category: fix +dev: Invalidates TaskCard resolution across remounts and authoritative workflow-setting SSE mutations. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index c44c8c8b85..7d2c678f20 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -242,7 +242,8 @@ Features: - Completed and archived task cards show a compact **Reverted** footer chip after a clean or already-reverted git outcome has persisted the source task's revert marker; conflicts, AI undo tasks, and revert PRs awaiting merge do not show it. -- Task cards show a compact **planner-overseer eye badge** (`data-testid="planner-overseer-state-badge"`) only when the engine reports a non-idle, non-off transient `plannerOverseerState` **and** the task's effective oversight is positively resolved as active and meaningfully configured. The eye uses the same inherited-default suppression as the oversight-level badge: a workflow declaration-default `autonomous` tier with no explicit per-task override shows neither eye nor an otherwise-empty `.card-header-badges` wrapper, while an explicit per-task `autonomous` override or resolved `observe`/`steer` tier can show it. Aggregate cards resolve inherited oversight through their task workflow badge; selected-workflow board cards resolve it through their trusted board workflow ID. Identity-less cards and pending, failed, or malformed inherited workflow-setting loads fail closed. When effective oversight is off or cannot be positively resolved, the eye badge and otherwise-empty `.card-header-badges` wrapper are both absent. This matches—but does not alter—the separate Task Detail `EyeOff` menu trigger. The eye badge is an active-overseer state marker, not a human-read/view indicator: `watching` means passive monitoring, `steering`/`recovering` mean active guidance or recovery is underway, and `awaiting-confirmation` means a human decision is required before the overseer can continue. Hover exposes the composed tooltip with the overseer's reason, watched stage/signal, and pending-confirmation note when present. + +- Task cards show a compact **planner-overseer eye badge** (`data-testid="planner-overseer-state-badge"`) only when the engine reports a non-idle, non-off transient `plannerOverseerState` **and** the task's effective oversight is positively resolved as active and meaningfully configured. The eye uses the same inherited-default suppression as the oversight-level badge: a workflow declaration-default `autonomous` tier with no explicit per-task override shows neither eye nor an otherwise-empty `.card-header-badges` wrapper, while an explicit per-task `autonomous` override or resolved `observe`/`steer` tier can show it. Aggregate cards resolve inherited oversight through their task workflow badge; selected-workflow board cards resolve it through their trusted board workflow ID. Identity-less cards and pending, failed, or malformed inherited workflow-setting loads fail closed. Successful workflow-setting writes invalidate that resolution immediately, and completed values are not retained across card remounts, so changing a workflow to `off` cannot leave an eye authorized by an earlier active value. When effective oversight is off or cannot be positively resolved, the eye badge and otherwise-empty `.card-header-badges` wrapper are both absent. This matches—but does not alter—the separate Task Detail `EyeOff` menu trigger. The eye badge is an active-overseer state marker, not a human-read/view indicator: `watching` means passive monitoring, `steering`/`recovering` mean active guidance or recovery is underway, and `awaiting-confirmation` means a human decision is required before the overseer can continue. Hover exposes the composed tooltip with the overseer's reason, watched stage/signal, and pending-confirmation note when present.