fix(webui): sync model badge after preset switch
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
Xubin Ren
co-authored by
Cursor
parent
b61c6304c3
commit
c92345bbb1
@@ -44,6 +44,7 @@ export function useNanobotStream(
|
||||
initialMessages: UIMessage[] = [],
|
||||
hasPendingToolCalls = false,
|
||||
onTurnEnd?: () => void,
|
||||
onModelNameChange?: (modelName: string | null) => void,
|
||||
): {
|
||||
messages: UIMessage[];
|
||||
isStreaming: boolean;
|
||||
@@ -181,6 +182,9 @@ export function useNanobotStream(
|
||||
}
|
||||
|
||||
if (ev.event === "message") {
|
||||
if (ev.model_name !== undefined) {
|
||||
onModelNameChange?.(ev.model_name || null);
|
||||
}
|
||||
if (
|
||||
suppressStreamUntilTurnEndRef.current &&
|
||||
(ev.kind === "tool_hint" || ev.kind === "progress")
|
||||
|
||||
Reference in New Issue
Block a user