mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-06-15 23:20:32 +03:00
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:
@@ -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),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user