Skip to content

Commit 5abf1d5

Browse files
committed
Clear validation errors after tool execution and adjust error display in ToolsTab
1 parent 36f5ba9 commit 5abf1d5

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

client/src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,8 @@ const App = () => {
801801
);
802802

803803
setToolResult(response);
804+
// Clear any validation errors since tool execution completed
805+
setErrors((prev) => ({ ...prev, tools: null }));
804806
} catch (e) {
805807
const toolResult: CompatibilityCallToolResult = {
806808
content: [
@@ -812,6 +814,8 @@ const App = () => {
812814
isError: true,
813815
};
814816
setToolResult(toolResult);
817+
// Clear validation errors - tool execution errors are shown in ToolResults
818+
setErrors((prev) => ({ ...prev, tools: null }));
815819
}
816820
};
817821

client/src/components/ToolsTab.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,15 @@ const ToolsTab = ({
131131
</h3>
132132
</div>
133133
<div className="p-4">
134-
{error ? (
135-
<Alert variant="destructive">
136-
<AlertCircle className="h-4 w-4" />
137-
<AlertTitle>Error</AlertTitle>
138-
<AlertDescription>{error}</AlertDescription>
139-
</Alert>
140-
) : selectedTool ? (
134+
{selectedTool ? (
141135
<div className="space-y-4">
136+
{error && (
137+
<Alert variant="destructive">
138+
<AlertCircle className="h-4 w-4" />
139+
<AlertTitle>Error</AlertTitle>
140+
<AlertDescription>{error}</AlertDescription>
141+
</Alert>
142+
)}
142143
<p className="text-sm text-gray-600 dark:text-gray-400">
143144
{selectedTool.description}
144145
</p>

0 commit comments

Comments
 (0)