From 18330929986a81445839022584f84e039e15e0c9 Mon Sep 17 00:00:00 2001 From: icarus Date: Mon, 22 Sep 2025 00:16:19 +0800 Subject: [PATCH] fix(useAgent): handle fake agent id to prevent unnecessary API calls --- src/renderer/src/hooks/agents/useAgent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderer/src/hooks/agents/useAgent.ts b/src/renderer/src/hooks/agents/useAgent.ts index 8ca0c865b5..62d2393618 100644 --- a/src/renderer/src/hooks/agents/useAgent.ts +++ b/src/renderer/src/hooks/agents/useAgent.ts @@ -7,7 +7,7 @@ export const useAgent = (id: string | null) => { const client = useAgentClient() const key = id ? client.agentPaths.withId(id) : null const fetcher = useCallback(async () => { - if (!id) { + if (!id || id === 'fake') { return null } const result = await client.getAgent(id)