diff --git a/ui/src/chat/ChatComposer.vue b/ui/src/chat/ChatComposer.vue index 2d3b7add3..972c169ec 100644 --- a/ui/src/chat/ChatComposer.vue +++ b/ui/src/chat/ChatComposer.vue @@ -220,7 +220,7 @@ function onKeydown(event: KeyboardEvent): void { aria-controls="slash-palette" :aria-expanded="isCommandMenuOpen && commandMatches.length ? 'true' : 'false'" :aria-activedescendant="isCommandMenuOpen && commandMatches.length ? `slash-palette-option-${commandSelection}` : undefined" - class="max-h-40 min-h-11 flex-1 resize-none border-0 bg-transparent! px-0 py-1 text-label focus-visible:ring-0" + class="max-h-40 min-h-11 flex-1 resize-none rounded-none border-0 bg-transparent! px-0 py-1 text-label shadow-none focus-visible:ring-0" @input="onInput" @keydown="onKeydown" /> diff --git a/ui/src/chat/state.ts b/ui/src/chat/state.ts index dac2a203f..ffc55504d 100644 --- a/ui/src/chat/state.ts +++ b/ui/src/chat/state.ts @@ -353,12 +353,13 @@ async function readTranscript(id: string): Promise { api.chatTurns(id), ]); const byAssistantMessage = new Map(); - // A failed turn records no reply, so its error follows the message it failed on. + // A failed or stopped turn records no reply, so what happened follows the + // message it was answering. const failedByInput = new Map(); for (const turn of turns || []) { const assistantID = turn.assistant_message_id || turn.AssistantMessageID; if (assistantID) byAssistantMessage.set(assistantID, turn); - else if (turn.status === "failed" && turn.input_message_id) + else if ((turn.status === "failed" || turn.status === "cancelled") && turn.input_message_id) failedByInput.set(turn.input_message_id, turn); } return (msgs || []).flatMap((message) => { @@ -370,7 +371,10 @@ async function readTranscript(id: string): Promise { message, { from: "assistant", - text: `Unable to complete that turn: ${failed.error || "unknown error"}`, + text: + failed.status === "cancelled" + ? "Stopped before replying." + : `Unable to complete that turn: ${failed.error || "unknown error"}`, tool_calls: failed.tool_calls || [], }, ];