fix: stop SSE/polling streams when switching sessions

This commit is contained in:
Nathan Flurry 2026-01-27 20:14:35 -08:00
parent 6bfc47f234
commit 7950c93f06

View file

@ -314,6 +314,8 @@ export default function App() {
};
const selectSession = (session: SessionInfo) => {
stopPolling();
stopSse();
stopTurnStream();
setSessionId(session.sessionId);
setAgentId(session.agent);
@ -328,6 +330,8 @@ export default function App() {
};
const createNewSession = async (nextAgentId?: string) => {
stopPolling();
stopSse();
stopTurnStream();
const selectedAgent = nextAgentId ?? agentId;
if (nextAgentId) {