From 4f1e895a2e11f4c44a5e19366d8a41337c6dc737 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Mon, 27 Jul 2026 12:08:30 -0700 Subject: [PATCH] [eric] chat: closeSession skips the server call for client-only draft sessions --- frontend/src/shared/state/agentsSlice.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/shared/state/agentsSlice.ts b/frontend/src/shared/state/agentsSlice.ts index 3c5da6cd..59b4dab6 100644 --- a/frontend/src/shared/state/agentsSlice.ts +++ b/frontend/src/shared/state/agentsSlice.ts @@ -504,7 +504,10 @@ export const handleApproval = createAsyncThunk( export const closeSession = createAsyncThunk( 'agents/closeSession', async ({ sessionId }: { sessionId: string }) => { - await fetch(`${AGENTS_API}/sessions/${sessionId}/close`, { method: 'POST' }); + // Drafts are client-only; the server has no such session and would 404. + if (!sessionId.startsWith('draft-')) { + await fetch(`${AGENTS_API}/sessions/${sessionId}/close`, { method: 'POST' }); + } return sessionId; } );