diff --git a/components/chat/chat-page.tsx b/components/chat/chat-page.tsx index b78e121..316c7ff 100644 --- a/components/chat/chat-page.tsx +++ b/components/chat/chat-page.tsx @@ -186,6 +186,7 @@ import { getUserMessageText, hydrateChatMessage, isHydratedAttachmentPart, + normalizeConversationTitle, parseApiErrorResponse, persistMessagesForConversation, releaseAttachmentPreview, @@ -194,6 +195,7 @@ import { resolveModelSelectPlaceholder, resolveStickToBottom, resolveStreamErrorContent, + shouldUseHarnessRuntime, trimConversation, validateAttachmentCompatibility, type ChatMessage, @@ -734,7 +736,7 @@ export function ChatPage() { modelId: selectedModelId || undefined, projectId: activeProjectId ?? undefined, providerId: selectedProviderId || undefined, - title: titleSeed || "Nova conversa", + title: normalizeConversationTitle(titleSeed), }) setActiveConversationId(response.conversation.id) @@ -1491,9 +1493,10 @@ export function ChatPage() { }) setBrowserProviderAuthState("signed-in") } else if ( - !temporaryChat && - selectedProviderId !== AUTO_PROVIDER_ID && - selectedModel?.capabilities.tools === true + shouldUseHarnessRuntime({ + supportsTools: selectedModel?.capabilities.tools === true, + temporaryChat, + }) ) { harnessConversationId = await ensureConversationId( (text || currentAttachments[0]?.fileName || "Nova conversa").slice( @@ -1588,6 +1591,12 @@ export function ChatPage() { updateAssistantToolCall(assistantMessageId, call) } } + if ( + event.type === "assistant/message" && + typeof event.payload.modelLabel === "string" + ) { + effectiveModelLabel = event.payload.modelLabel + } }, ) fullText += result.text @@ -2292,7 +2301,10 @@ export function ChatPage() { value={selectedProviderId} onValueChange={setSelectedProviderId} > - + @@ -2402,7 +2414,10 @@ export function ChatPage() { models.length === 0 } > - +