diff --git a/packages/web-ui/src/components/Messages.ts b/packages/web-ui/src/components/Messages.ts index 8e121123..433faca3 100644 --- a/packages/web-ui/src/components/Messages.ts +++ b/packages/web-ui/src/components/Messages.ts @@ -112,7 +112,8 @@ export class AssistantMessage extends LitElement { const tool = this.tools?.find((t) => t.name === chunk.name); const pending = this.pendingToolCalls?.has(chunk.id) ?? false; const result = this.toolResultsById?.get(chunk.id); - const aborted = !pending && !result && !this.isStreaming; + // A tool call is aborted if the message was aborted and there's no result for this tool call + const aborted = this.message.stopReason === "aborted" && !result; orderedParts.push( html` | undefined = this.aborted + ? { role: "toolResult", isError: true, output: "", toolCallId: this.toolCall.id, toolName: this.toolCall.name } + : this.result; + const toolContent = renderTool( + toolName, + this.toolCall.arguments, + result, + !this.aborted && (this.isStreaming || this.pending), + ); return html`
diff --git a/packages/web-ui/src/components/ProviderKeyInput.ts b/packages/web-ui/src/components/ProviderKeyInput.ts index db5ccee9..e569c1bd 100644 --- a/packages/web-ui/src/components/ProviderKeyInput.ts +++ b/packages/web-ui/src/components/ProviderKeyInput.ts @@ -45,7 +45,8 @@ export class ProviderKeyInput extends LitElement { private async testApiKey(provider: string, apiKey: string): Promise { try { const modelId = TEST_MODELS[provider]; - if (!modelId) return false; + // Returning true here for Ollama and friends. Can' know which model to use for testing + if (!modelId) return true; let model = getModel(provider as any, modelId); if (!model) return false; diff --git a/packages/web-ui/src/tools/artifacts/artifacts.ts b/packages/web-ui/src/tools/artifacts/artifacts.ts index 1b25feac..4ffee7d5 100644 --- a/packages/web-ui/src/tools/artifacts/artifacts.ts +++ b/packages/web-ui/src/tools/artifacts/artifacts.ts @@ -449,7 +449,7 @@ export class ArtifactsPanel extends LitElement { let result = `Updated file ${params.filename}`; if (this.getFileType(params.filename) === "html" && !options.skipWait) { const logs = await this.waitForHtmlExecution(params.filename); - result += logs; + result += `\n${logs}`; } return result;