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; } );