mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-07 02:58:21 +00:00
fix: chat freezes when reopened after tool calls with some Responses API providers (#31838)
Some providers, such as OpenVINO Model Server, number their output items from zero again in every response. When a model wrote text, called a tool and then answered, the saved message held two items with the same id, and opening that chat later locked up the browser tab. Repeated ids are now renamed when the chat is shown, so these chats open normally, including ones saved before this fix. Providers that already send unique ids render exactly as before. Fixes #31837
This commit is contained in:
parent
ecaa1a1bbc
commit
8b4d3ac527
1 changed files with 10 additions and 0 deletions
|
|
@ -434,6 +434,16 @@ export function buildOutputDisplayItems(output: OutputItem[] = []): OutputDispla
|
|||
});
|
||||
|
||||
flushDetails();
|
||||
|
||||
// Providers can reuse item ids across tool-call rounds.
|
||||
const seenIds = new Set<string>();
|
||||
displayItems.forEach((displayItem, index) => {
|
||||
if (seenIds.has(displayItem.id)) {
|
||||
displayItem.id = `${displayItem.id}-${index}`;
|
||||
}
|
||||
seenIds.add(displayItem.id);
|
||||
});
|
||||
|
||||
return displayItems;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue