mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-30 19:59:38 +02:00
[eric] chat: closeSession skips the server call for client-only draft sessions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user