Clear validation errors after tool execution and adjust error display in ToolsTab
This commit is contained in:
parent
36f5ba995b
commit
5abf1d5052
2 changed files with 12 additions and 7 deletions
|
|
@ -801,6 +801,8 @@ const App = () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
setToolResult(response);
|
setToolResult(response);
|
||||||
|
// Clear any validation errors since tool execution completed
|
||||||
|
setErrors((prev) => ({ ...prev, tools: null }));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const toolResult: CompatibilityCallToolResult = {
|
const toolResult: CompatibilityCallToolResult = {
|
||||||
content: [
|
content: [
|
||||||
|
|
@ -812,6 +814,8 @@ const App = () => {
|
||||||
isError: true,
|
isError: true,
|
||||||
};
|
};
|
||||||
setToolResult(toolResult);
|
setToolResult(toolResult);
|
||||||
|
// Clear validation errors - tool execution errors are shown in ToolResults
|
||||||
|
setErrors((prev) => ({ ...prev, tools: null }));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,14 +131,15 @@ const ToolsTab = ({
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
{error ? (
|
{selectedTool ? (
|
||||||
<Alert variant="destructive">
|
|
||||||
<AlertCircle className="h-4 w-4" />
|
|
||||||
<AlertTitle>Error</AlertTitle>
|
|
||||||
<AlertDescription>{error}</AlertDescription>
|
|
||||||
</Alert>
|
|
||||||
) : selectedTool ? (
|
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
{error && (
|
||||||
|
<Alert variant="destructive">
|
||||||
|
<AlertCircle className="h-4 w-4" />
|
||||||
|
<AlertTitle>Error</AlertTitle>
|
||||||
|
<AlertDescription>{error}</AlertDescription>
|
||||||
|
</Alert>
|
||||||
|
)}
|
||||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||||
{selectedTool.description}
|
{selectedTool.description}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue