fix: better agent errors in settings agent section (#8198)

fix: better mcp error

Co-authored-by: Nate <sestinj@gmail.com>
This commit is contained in:
Dallin Romney 2025-10-13 23:19:55 -07:00 • committed by GitHub
parent ee269fa5d2
commit fbaec428cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 4 deletions

View file

@ -189,6 +189,7 @@ export async function loadJsonMcpConfigs(
...c.warnings.map((warning) => ({
fatal: false,
message: warning,
uri: c.yamlConfig.sourceFile,
})),
);
return convertYamlMcpConfigToInternalMcpOptions(

View file

@ -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 (
<div key={profile.id}>
<div className="flex items-center justify-between">
<div className="flex items-center justify-between gap-3">
<div className="flex items-baseline gap-3">
<div className="flex h-6 w-6 flex-shrink-0 items-center justify-center">
<AssistantIcon assistant={profile} />
</div>
<div className="flex flex-1 flex-col gap-2">
<h3
className={`my-2 text-sm font-medium ${errors && errors.length > 0 ? "text-error" : ""}`}
className={`my-2 text-sm font-medium ${
hasFatalErrors
? "text-error"
: hasErrors
? "text-yellow-500"
: ""
}`}
>
{profile.title}
</h3>
@ -51,8 +60,20 @@ export function ConfigsSection() {
<div className="space-y-1 overflow-hidden">
{errors.map((error, errorIndex) => (
<div
onClick={(e) => {
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}
</div>

View file

@ -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.`,
);
}

View file

@ -3,6 +3,7 @@ import { ConfigYaml, configYamlSchema } from "./schemas/index.js";
export interface ConfigValidationError {
fatal: boolean;
message: string;
uri?: string;
}
export interface ConfigResult<T> {