fix(agent-dashboard): persist acknowledgedAgentsByPaneKey across restart

Without this, agent rows the user already visited come back bold every relaunch now that the rows themselves survive restart (per docs/agent-dashboard-retention-restart.md). Hydrate sanitizes input field-by-field (rejects null/non-object/array, prototype-pollution keys, non-finite/non-positive values) and applies a 7-day TTL paralleling HYDRATE_MAX_AGE_MS in agent-hooks/server.ts so hard-quit/crash paths can't grow the persisted map forever.

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
brennanb2025
2026-05-10 22:58:53 -07:00
co-authored by Orca
parent bff9989709
commit d6827bd344
6 changed files with 251 additions and 8 deletions
+2 -1
View File
@@ -292,7 +292,8 @@ export function getDefaultUIState(): PersistedUIState {
statusBarVisible: true,
dismissedUpdateVersion: null,
lastUpdateCheckAt: null,
trustedOrcaHooks: {}
trustedOrcaHooks: {},
acknowledgedAgentsByPaneKey: {}
}
}
+9
View File
@@ -1461,6 +1461,15 @@ export type PersistedUIState = {
/** Once the user has seen the "your sessions won't be interrupted"
* reassurance card, we never show it again. */
updateReassuranceSeen?: boolean
/** Per-paneKey "user has visited this row" timestamps, used by the inline
* agents list to mute rows the user has already seen. Persisted because
* agent rows themselves now survive restart (see
* docs/agent-dashboard-retention-restart.md); without persisting acks too,
* rows you'd already clicked come back bold on relaunch. Stale entries
* keyed on dead panes are inert: a future paneKey reuse stamps a fresh
* stateStartedAt that beats the old ack via the existing comparison in
* WorktreeCardAgents. Renderer-owned, written through ui:set. */
acknowledgedAgentsByPaneKey?: Record<string, number>
/** URL to navigate to when a new browser tab is opened. Null means blank tab.
* Phase 3 will expand this to a full BrowserSessionProfile per workspace. */
browserDefaultUrl?: string | null