From cac6dfbe45e080797b9f6d03dc447eeb932bdba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=9E=97?= <2281216234@qq.com> Date: Sun, 30 Aug 2026 18:16:15 +0800 Subject: [PATCH 1/2] fix(explorer): surface server error detail in graph loading failures (#1260) The nodes/edges fetch loops were throwing away the response body whenever the request returned a non-OK status. Because of that, errors like a `503` caused by a missing `SEMANTICA_API_KEY` only showed up as: `Fetch failed: 503` even though the backend was already returning a more useful message in the response `detail`. This change reads the JSON error body and includes `detail` in the thrown error when it's a string, so `GraphLoadingOverlay` can show the actual backend error to the user. Closes #1256 --- .../workspaces/GraphWorkspace/useLoadGraph.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts b/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts index f23c563a..cc39df99 100644 --- a/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts +++ b/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts @@ -318,6 +318,20 @@ interface EdgeListResponse { const PAGE_LIMIT = 1000; +/** Surface the server's `detail` message (e.g. auth/setup guidance) on non-OK responses. */ +async function fetchErrorDetail(response: Response): Promise { + try { + const body: unknown = await response.json(); + const detail = (body as { detail?: unknown } | null)?.detail; + if (typeof detail === "string" && detail.trim()) { + return ` — ${detail.trim()}`; + } + } catch { + // Non-JSON or unreadable body: fall back to the status-only message. + } + return ""; +} + async function fetchAllNodes( signal: AbortSignal, onProgress?: (progress: GraphLoadProgress) => void, @@ -335,7 +349,7 @@ async function fetchAllNodes( const response = await fetch(url.toString(), { signal }); if (!response.ok) { - throw new Error(`Fetch failed: ${response.status}`); + throw new Error(`Fetch failed: ${response.status}${await fetchErrorDetail(response)}`); } const data: NodeListResponse = await response.json(); @@ -390,7 +404,7 @@ async function fetchAllEdges( const response = await fetch(url.toString(), { signal }); if (!response.ok) { - throw new Error(`Fetch failed: ${response.status}`); + throw new Error(`Fetch failed: ${response.status}${await fetchErrorDetail(response)}`); } const data: EdgeListResponse = await response.json(); From f6cd62411b9849d364edd50ced21c8397a90ee02 Mon Sep 17 00:00:00 2001 From: Shubham Srivastava Date: Sun, 30 Aug 2026 11:23:43 +0100 Subject: [PATCH 2/2] test(integrations): make crewai and langchain test dirs packages (#1252) Both directories contain a test_degradation.py. Neither had an __init__.py, so under pytest's default prepend import mode both modules were imported as plain 'test_degradation' and the second collided with the first: import file mismatch: imported module 'test_degradation' has this __file__ attribute: tests/integrations/crewai/test_degradation.py which is not the same as the test file we want to collect: tests/integrations/langchain/test_degradation.py That aborted collection for tests/integrations/, so the langchain graceful-degradation tests never ran. tests/integrations/__init__.py already exists, and most directories under tests/ carry one; these two subpackages were simply missed. Collection goes from 335 collected, 1 error to 337 collected. Closes #1251 --- tests/integrations/crewai/__init__.py | 1 + tests/integrations/langchain/__init__.py | 1 + 2 files changed, 2 insertions(+) create mode 100644 tests/integrations/crewai/__init__.py create mode 100644 tests/integrations/langchain/__init__.py diff --git a/tests/integrations/crewai/__init__.py b/tests/integrations/crewai/__init__.py new file mode 100644 index 00000000..ff5c7e0b --- /dev/null +++ b/tests/integrations/crewai/__init__.py @@ -0,0 +1 @@ +# tests/integrations/crewai package diff --git a/tests/integrations/langchain/__init__.py b/tests/integrations/langchain/__init__.py new file mode 100644 index 00000000..c78b7fb4 --- /dev/null +++ b/tests/integrations/langchain/__init__.py @@ -0,0 +1 @@ +# tests/integrations/langchain package