fix(web): 主代理执行结束时刷新 topic 列表以更新 token 统计

LLM usage 在消息持久化后已写入 DB,主代理本次执行结束时触发 bumpTopicRefreshTrigger,list_topics 重新读取最新 token 统计并更新侧边栏。
This commit is contained in:
oudecheng 2026-08-05 11:15:12 +08:00
parent 6fc6d5628f
commit beb7b581a6

View File

@ -170,6 +170,9 @@ export function useMessages(options: UseMessagesOptions): UseMessagesReturn {
if (getSubagentTaskId(message)) return true;
if (msg.topic_id && msg.topic_id !== selectedTopicRef.current) return true;
setIsLoading(false);
// 主代理本次执行结束:刷新 topic 列表以更新 token 统计
// LLM usage 在消息持久化后已写入 DBlist_topics 会读到最新值)
bumpTopicRefreshTrigger();
return true;
}