test(agent-status): make the notification-id test fail on the pre-fix ordering

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.
This commit is contained in:
Brennan Benson
2026-08-14 14:17:41 -07:00
parent 94e7f30fda
commit 337e21ef71
@@ -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()