[eric] chat: closeSession skips the server call for client-only draft sessions

This commit is contained in:
ciregenz
2026-07-27 12:08:30 -07:00
parent 56ec809ca5
commit 4f1e895a2e
+4 -1
View File
@@ -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;
}
);