From 4beec4cf240607114dce1cc9b07a85a8b1585dac Mon Sep 17 00:00:00 2001 From: Otto Date: Sat, 14 Feb 2026 13:14:51 +0000 Subject: [PATCH] fix: add 404 response to OpenAPI spec, fix TypeScript type for optional title --- autogpt_platform/backend/backend/api/features/chat/routes.py | 1 + .../(platform)/copilot/components/ChatSidebar/ChatSidebar.tsx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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