Patch agent thoughts UI bug (#4549)

patch agent ui bug where text would show up in agent thoughts

Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
This commit is contained in:
Sean Hatfield
2025-10-15 15:55:54 -07:00
committed by GitHub
parent d3619689db
commit 151f97da9a

View File

@@ -78,6 +78,27 @@ export default function handleSocketResponse(socket, event, setChatHistory) {
];
}
// Handle textResponseChunk initialization as textResponse instead of statusResponse.
// Without this the first chunk creates a statusResponse (thought bubble) by falling through to the default case.
// Providers like Gemini send large chunks and can complete in a single chunk before the update logic can convert it.
// Other providers send many small chunks so the second chunk triggers the update logic to fix the type.
if (data.content.type === "textResponseChunk") {
return [
...prev.filter((msg) => !!msg.content),
{
uuid: data.content.uuid,
type: "textResponse",
content: data.content.content,
role: "assistant",
sources: [],
closed: true,
error: null,
animate: false,
pending: false,
},
];
}
return [
...prev.filter((msg) => !!msg.content),
{