feat: add notification

This commit is contained in:
Henry Li
2026-01-31 11:08:27 +08:00
parent 835fd4d0c7
commit 5295f5b5b9
18 changed files with 482 additions and 56 deletions

View File

@@ -18,9 +18,11 @@ import type {
export function useThreadStream({
threadId,
isNewThread,
onFinish,
}: {
isNewThread: boolean;
threadId: string | null | undefined;
onFinish?: (state: AgentThreadState) => void;
}) {
const queryClient = useQueryClient();
const thread = useStream<AgentThreadState>({
@@ -30,6 +32,7 @@ export function useThreadStream({
reconnectOnMount: true,
fetchStateHistory: true,
onFinish(state) {
onFinish?.(state.values);
// void queryClient.invalidateQueries({ queryKey: ["threads", "search"] });
queryClient.setQueriesData(
{