fix: preserve manually selected agent in AI Assist during streaming

This commit is contained in:
Gemini AI
2025-12-29 02:15:31 +04:00
Unverified
parent 0113ba7624
commit 738ba6cc3a

View File

@@ -157,8 +157,8 @@ const ThinkingIndicator = () => (
// --- Helper Functions ---
function parseStreamingContent(text: string) {
let agent = "general";
function parseStreamingContent(text: string, currentAgent: string) {
let agent = currentAgent;
let preview: PreviewData | null = null;
let chatDisplay = text.trim();
let status: string | null = null;
@@ -351,7 +351,7 @@ export default function AIAssist() {
currentAgent,
onChunk: (chunk) => {
accumulated += chunk;
const { chatDisplay, preview, agent, status: streamStatus } = parseStreamingContent(accumulated);
const { chatDisplay, preview, agent, status: streamStatus } = parseStreamingContent(accumulated, currentAgent);
if (streamStatus) setStatus(streamStatus);