Fixed failing tests
This commit is contained in:
parent
7624eefc1e
commit
78c56b350b
2 changed files with 5 additions and 27 deletions
|
|
@ -472,6 +472,9 @@ const ToolsTab = ({
|
||||||
)}
|
)}
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
// Validate JSON inputs before calling tool
|
||||||
|
if (checkValidationErrors()) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsToolRunning(true);
|
setIsToolRunning(true);
|
||||||
const meta = metaEntries.reduce<Record<string, unknown>>(
|
const meta = metaEntries.reduce<Record<string, unknown>>(
|
||||||
|
|
@ -490,7 +493,7 @@ const ToolsTab = ({
|
||||||
setIsToolRunning(false);
|
setIsToolRunning(false);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
disabled={isToolRunning}
|
disabled={isToolRunning || hasValidationErrors}
|
||||||
>
|
>
|
||||||
{isToolRunning ? (
|
{isToolRunning ? (
|
||||||
<>
|
<>
|
||||||
|
|
@ -505,32 +508,6 @@ const ToolsTab = ({
|
||||||
)}
|
)}
|
||||||
</Button>
|
</Button>
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Button
|
|
||||||
onClick={async () => {
|
|
||||||
// Validate JSON inputs before calling tool
|
|
||||||
if (checkValidationErrors()) return;
|
|
||||||
|
|
||||||
try {
|
|
||||||
setIsToolRunning(true);
|
|
||||||
await callTool(selectedTool.name, params);
|
|
||||||
} finally {
|
|
||||||
setIsToolRunning(false);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
disabled={isToolRunning || hasValidationErrors}
|
|
||||||
>
|
|
||||||
{isToolRunning ? (
|
|
||||||
<>
|
|
||||||
<Loader2 className="w-4 h-4 mr-2 animate-spin" />
|
|
||||||
Running...
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Send className="w-4 h-4 mr-2" />
|
|
||||||
Run Tool
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
<Button
|
<Button
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -835,6 +835,7 @@ describe("ToolsTab", () => {
|
||||||
message: "test message",
|
message: "test message",
|
||||||
count: 5,
|
count: 5,
|
||||||
},
|
},
|
||||||
|
undefined,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue