From fbaec428cc0bd5626f1ac486b7927cc02e8ff0ac Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 13 Oct 2025 23:19:55 -0700 Subject: [PATCH] fix: better agent errors in settings agent section (#8198) fix: better mcp error Co-authored-by: Nate --- core/context/mcp/json/loadJsonMcpConfigs.ts | 1 + .../pages/config/sections/ConfigsSection.tsx | 27 ++++++++++++++++--- .../src/schemas/mcp/convertJson.ts | 2 +- packages/config-yaml/src/validation.ts | 1 + 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/core/context/mcp/json/loadJsonMcpConfigs.ts b/core/context/mcp/json/loadJsonMcpConfigs.ts index 01ed60bae..5600a27ee 100644 --- a/core/context/mcp/json/loadJsonMcpConfigs.ts +++ b/core/context/mcp/json/loadJsonMcpConfigs.ts @@ -189,6 +189,7 @@ export async function loadJsonMcpConfigs( ...c.warnings.map((warning) => ({ fatal: false, message: warning, + uri: c.yamlConfig.sourceFile, })), ); return convertYamlMcpConfigToInternalMcpOptions( diff --git a/gui/src/pages/config/sections/ConfigsSection.tsx b/gui/src/pages/config/sections/ConfigsSection.tsx index 25d32ffed..b7a6eaad8 100644 --- a/gui/src/pages/config/sections/ConfigsSection.tsx +++ b/gui/src/pages/config/sections/ConfigsSection.tsx @@ -34,16 +34,25 @@ export function ConfigsSection() { profiles.map((profile, index) => { const isSelected = profile.id === selectedProfile?.id; const errors = isSelected ? configError : profile.errors; + const hasFatalErrors = + errors && errors.some((error) => error.fatal); + const hasErrors = errors && errors.length > 0; return (
-
+

0 ? "text-error" : ""}`} + className={`my-2 text-sm font-medium ${ + hasFatalErrors + ? "text-error" + : hasErrors + ? "text-yellow-500" + : "" + }`} > {profile.title}

@@ -51,8 +60,20 @@ export function ConfigsSection() {
{errors.map((error, errorIndex) => (
{ + if (error.uri) { + e.stopPropagation(); + ideMessenger.post("openFile", { + path: error.uri, + }); + } + }} key={errorIndex} - className="text-error bg-error/10 rounded py-1 pr-2 text-xs" + className={`${ + error.fatal + ? "text-error bg-error/10" + : "bg-yellow-500/10 text-yellow-500" + } rounded border border-solid border-transparent px-2 py-1 text-xs ${error.uri ? "cursor-pointer " + (error.fatal ? "hover:border-error" : "hover:border-yellow-500") : ""}`} > {error.message}
diff --git a/packages/config-yaml/src/schemas/mcp/convertJson.ts b/packages/config-yaml/src/schemas/mcp/convertJson.ts index 87fa24806..662f8e419 100644 --- a/packages/config-yaml/src/schemas/mcp/convertJson.ts +++ b/packages/config-yaml/src/schemas/mcp/convertJson.ts @@ -59,7 +59,7 @@ export function convertJsonMcpConfigToYamlMcpConfig( if ("command" in jsonConfig) { if (jsonConfig.envFile) { warnings.push( - `envFile is not supported in Continue MCP config (server "${name}"). Environment variables from this file will not be used.`, + `envFile is not supported in Continue MCP configuration (server "${name}"). Environment variables from file will not be used.`, ); } diff --git a/packages/config-yaml/src/validation.ts b/packages/config-yaml/src/validation.ts index 766f852bd..874eb3ad8 100644 --- a/packages/config-yaml/src/validation.ts +++ b/packages/config-yaml/src/validation.ts @@ -3,6 +3,7 @@ import { ConfigYaml, configYamlSchema } from "./schemas/index.js"; export interface ConfigValidationError { fatal: boolean; message: string; + uri?: string; } export interface ConfigResult {