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() {
- +