From 970e1613902fbeef05a9946e08940d48a11c1290 Mon Sep 17 00:00:00 2001 From: Ajax Davis Date: Fri, 12 Dec 2025 04:56:02 +1000 Subject: [PATCH] fix(health-check): treat env var errors from executor 500 responses as HEALTHY The executor returns HTTP 500 for all tool errors, including missing env vars. Before: 500 response = BROKEN After: Check error message for env/validation patterns before marking BROKEN This ensures tools that require API keys (like @parallel-web/ai-sdk-tools) show importHealth: HEALTHY since the tool loads correctly - it just needs config. --- apps/playground/next-env.d.ts | 2 +- .../web/src/lib/health-check/health-check-service.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/playground/next-env.d.ts b/apps/playground/next-env.d.ts index c4b7818..9edff1c 100644 --- a/apps/playground/next-env.d.ts +++ b/apps/playground/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -import "./.next/dev/types/routes.d.ts"; +import "./.next/types/routes.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/web/src/lib/health-check/health-check-service.ts b/apps/web/src/lib/health-check/health-check-service.ts index 6c03f25..254b0c7 100644 --- a/apps/web/src/lib/health-check/health-check-service.ts +++ b/apps/web/src/lib/health-check/health-check-service.ts @@ -136,13 +136,17 @@ async function checkExecutionHealth(tool: Tool & { package: Package }): Promise< return { status: 'HEALTHY', error: null, timeMs, testParams }; } - // HTTP error from executor itself (not from tool) - // This could be executor down, rate limited, etc. + // HTTP error from executor - could be tool-level or infrastructure const data = await response.json().catch(() => ({})); const error = data.error || `HTTP ${response.status}`; - // Even HTTP errors might be tool-level errors returned through executor - // Only mark as BROKEN for true infrastructure failures + // Check if this is a config/validation error (tool is working, just missing setup) + // The executor returns 500 for all tool errors, so we need to inspect the message + if (isNonBreakingError(error)) { + return { status: 'HEALTHY', error: null, timeMs, testParams }; + } + + // True infrastructure failures (executor down, rate limited, etc.) if (response.status >= 500) { return { status: 'BROKEN', error, timeMs, testParams }; }