From 28b5e6b6fed8ad0b27af36af6818119c86280c96 Mon Sep 17 00:00:00 2001 From: Best Codes <106822363+The-Best-Codes@users.noreply.github.com> Date: Mon, 16 Jun 2025 11:18:31 -0500 Subject: [PATCH] fix: improved GoosehintsModal error handling (#2932) --- ui/desktop/openapi.json | 2 +- ui/desktop/src/components/GoosehintsModal.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/desktop/openapi.json b/ui/desktop/openapi.json index ffd9dca2..cae67212 100644 --- a/ui/desktop/openapi.json +++ b/ui/desktop/openapi.json @@ -10,7 +10,7 @@ "license": { "name": "Apache-2.0" }, - "version": "1.0.27" + "version": "1.0.28" }, "paths": { "/agent/tools": { diff --git a/ui/desktop/src/components/GoosehintsModal.tsx b/ui/desktop/src/components/GoosehintsModal.tsx index f7cab002..b8d66628 100644 --- a/ui/desktop/src/components/GoosehintsModal.tsx +++ b/ui/desktop/src/components/GoosehintsModal.tsx @@ -106,9 +106,12 @@ export const GoosehintsModal = ({ directory, setIsGoosehintsModalOpen }: Goosehi const { file, error, found } = await getGoosehintsFile(goosehintsFilePath); setGoosehintsFile(file); setGoosehintsFileFound(found); - setGoosehintsFileReadError(error || ''); + // Only set error if file was found but there was an actual read error + // If file is not found, treat it as creating a new file (no error) + setGoosehintsFileReadError(found && error ? error : ''); } catch (error) { console.error('Error fetching .goosehints file:', error); + setGoosehintsFileReadError('Failed to access .goosehints file'); } }; if (directory) fetchGoosehintsFile();