fix: scope lifecycle notifications to active session, remove mock mode

- Only show hookHistory/lifecycleEvent when viewing the agent's current
  live session, preventing notification leaking to historical sessions
- Reset notifications on SessionStart (like hookHistory already does)
- Remove mock/demo animation mode from SessionLifecycleStatus
- Delete dead useHooksApproval composable (never imported)
This commit is contained in:
2026-02-24 11:58:05 -06:00
parent 08e73a1eb6
commit 509ec1847b
5 changed files with 319 additions and 300 deletions

View File

@@ -322,8 +322,12 @@ class SessionStateManager {
// Build notification
const notification = buildNotification(payload)
const updatedNotifications = [...state.notifications, notification].slice(-MAX_NOTIFICATIONS)
patch.notifications = updatedNotifications
if (payload.hook_event_name === 'SessionStart') {
// Reset notifications on new session, only keep the SessionStart notification
patch.notifications = [notification]
} else {
patch.notifications = [...state.notifications, notification].slice(-MAX_NOTIFICATIONS)
}
// Build hook history entry
const historyEntry: HookHistoryEntry = {