From 337e21ef71b4a1187b7edebd2bc99d1a35a7fb29 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Fri, 14 Aug 2026 14:17:41 -0700 Subject: [PATCH] test(agent-status): make the notification-id test fail on the pre-fix ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stored row inherited the helper's default codex agentType while the event named claude, so agentSnapshotMatchesExplicitTitle dropped it and freshStoredAgentStatus was undefined — the assertion held under either side of the `??`. Name the stored row's agent so the pinned working row survives and the snapshot-first precedence is what the test actually pins. --- .../terminal-pane/use-notification-dispatch.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts b/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts index be8fb662f89..0a862e380ac 100644 --- a/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts +++ b/src/renderer/src/components/terminal-pane/use-notification-dispatch.test.ts @@ -192,9 +192,13 @@ describe('dispatchTerminalNotification', () => { it('builds the notification id from a completion snapshot, not the pinned working row', () => { const pinnedWorkingStartedAt = Date.now() - 60_000 + // Why: the stored row must name the event's agent, or it is dropped for identity mismatch + // and the assertion would hold whichever side of the `??` wins. mockState.agentStatusByPaneKey[paneKey] = makeAgentStatus(paneKey, { state: 'working', - stateStartedAt: pinnedWorkingStartedAt + stateStartedAt: pinnedWorkingStartedAt, + agentType: 'claude', + terminalTitle: 'claude' }) const turnCompletedAt = Date.now()