90527a5ae4
Classifier-refusal failures end a turn with stopReason === "error" but get pruned from the active context (agent-session.ts's #removeAssistantMessageFromActiveContext) before agent_end fires. sendErrorNotification() read viewSession.getLastAssistantMessage(), which reflects that mutated context and silently missed the notification for exactly the turns it should fire on. Thread the agent_end event through #handleAgentEnd -> #finishAgentEnd so sendErrorNotification reads the turn's own outcome from agent_end.messages instead.