diff --git a/autogpt_platform/backend/backend/api/features/chat/routes.py b/autogpt_platform/backend/backend/api/features/chat/routes.py index aa95373257..d838520c98 100644 --- a/autogpt_platform/backend/backend/api/features/chat/routes.py +++ b/autogpt_platform/backend/backend/api/features/chat/routes.py @@ -216,6 +216,7 @@ async def create_session( "/sessions/{session_id}", dependencies=[Security(auth.requires_user)], status_code=204, + responses={404: {"description": "Session not found or access denied"}}, ) async def delete_session( session_id: str, diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx index 4ef1f58c48..8e785dd9d3 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx @@ -31,7 +31,7 @@ export function ChatSidebar() { const [sessionId, setSessionId] = useQueryState("sessionId", parseAsString); const [sessionToDelete, setSessionToDelete] = useState<{ id: string; - title: string | null; + title: string | null | undefined; } | null>(null); const queryClient = useQueryClient(); @@ -79,7 +79,7 @@ export function ChatSidebar() { function handleDeleteClick( e: React.MouseEvent, id: string, - title: string | null, + title: string | null | undefined, ) { e.stopPropagation(); // Prevent session selection if (isDeleting) return; // Prevent double-click during deletion