Fix spinner showing on aborted tool calls in javascript-repl and artifacts renderers

When isStreaming is false and there's no result (aborted state), show 'complete' state instead of 'inprogress' to avoid showing the spinner.
This commit is contained in:
Mario Zechner 2025-10-08 14:43:23 +02:00
parent 46b1abff1d
commit b3cce7b400
2 changed files with 2 additions and 2 deletions

View file

@ -55,7 +55,7 @@ export class ArtifactsToolRenderer implements ToolRenderer<ArtifactsParams, unde
result: ToolResultMessage<undefined> | undefined,
isStreaming?: boolean,
): TemplateResult {
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "inprogress";
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "complete";
// Create refs for collapsible sections
const contentRef = createRef<HTMLDivElement>();

View file

@ -253,7 +253,7 @@ export const javascriptReplRenderer: ToolRenderer<JavaScriptReplParams, JavaScri
isStreaming?: boolean,
): TemplateResult {
// Determine status
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "inprogress";
const state = result ? (result.isError ? "error" : "complete") : isStreaming ? "inprogress" : "complete";
// Create refs for collapsible code section
const codeContentRef = createRef<HTMLDivElement>();