From f09a1ad7fc9c8019317b43b148d03c54539aa81d Mon Sep 17 00:00:00 2001 From: Dan Lew Date: Tue, 23 Jun 2026 16:15:44 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20fix:=20Order=20Enabled=20Guard?= =?UTF-8?q?=20After=20Config=20Expansion=20in=20`useGetAgentByIdQuery`=20(?= =?UTF-8?q?#13927)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, it's possible for a config to override the `isValidAgentId` check. Without that check, it's possible to query `getAgentById()` with a blank `agent_id`, which can result in polluting the `QueryKeys.agent` cache with a full list of agents (instead of just a single agent result). --- client/src/data-provider/Agents/queries.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/data-provider/Agents/queries.ts b/client/src/data-provider/Agents/queries.ts index 5bea90e845..3040de4d9d 100644 --- a/client/src/data-provider/Agents/queries.ts +++ b/client/src/data-provider/Agents/queries.ts @@ -104,8 +104,8 @@ export const useGetAgentByIdQuery = ( refetchOnReconnect: false, refetchOnMount: false, retry: false, - enabled: isValidAgentId && (config?.enabled ?? true), ...config, + enabled: isValidAgentId && (config?.enabled ?? true), }, ); };