From 19bef49d4e225bd6145f28697794039fa0e0087e Mon Sep 17 00:00:00 2001 From: Anton A S Date: Thu, 12 Mar 2026 22:13:45 +0300 Subject: [PATCH] Show thinking indicator between tool calls during streaming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the typing indicator only showed during 'submitted' status (before first token). Once streaming began, gaps between tool calls had no visual feedback — user saw silence and thought AI stopped. Now isThinking is true when: - status is submitted (waiting for first token) - status is streaming and last part is a completed tool call or step-start (AI deciding what to do next) --- src/components/ChatPanel.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/ChatPanel.vue b/src/components/ChatPanel.vue index 0011f849a..d0fcd6b9e 100644 --- a/src/components/ChatPanel.vue +++ b/src/components/ChatPanel.vue @@ -23,6 +23,21 @@ const debugCopied = ref(false) const messages = computed(() => chat.value?.messages ?? []) const status = computed(() => chat.value?.status ?? 'ready') +const isThinking = computed(() => { + const s = status.value + if (s !== 'submitted' && s !== 'streaming') return false + if (messages.value.length === 0) return true + const last = messages.value[messages.value.length - 1] + if (last.role !== 'assistant') return true + const parts = last.parts + if (parts.length === 0) return true + const lastPart = parts[parts.length - 1] as Record + if (lastPart.type === 'step-start') return true + if ('toolCallId' in lastPart && lastPart.state === 'output-available') return true + if ('toolCallId' in lastPart && lastPart.state === 'output-error') return true + return s === 'submitted' +}) + const showContinue = computed(() => { if (status.value !== 'ready') return false if (messages.value.length === 0) return false @@ -87,9 +102,9 @@ function handleClearChat() {
- +