mirror of
https://github.com/zadam/trilium.git
synced 2026-05-08 01:26:42 +02:00
fix(llm): stopping a tool call leaves an infinite spinner
This commit is contained in:
@@ -259,6 +259,16 @@ export function useLlmChat(
|
||||
|
||||
/** Shared cleanup: finalize collected content and reset streaming state. */
|
||||
function finalizeStream() {
|
||||
// Mark any in-progress tool calls as stopped so they don't show infinite spinners
|
||||
for (const [i, block] of contentBlocks.entries()) {
|
||||
if (block.type === "tool_call" && !block.toolCall.result) {
|
||||
contentBlocks[i] = {
|
||||
type: "tool_call",
|
||||
toolCall: { ...block.toolCall, result: "[Stopped]", isError: true }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
const finalNewMessages: StoredMessage[] = [];
|
||||
|
||||
if (thinkingContent) {
|
||||
|
||||
Reference in New Issue
Block a user