Skip to content

Commit 2b22ee2

Browse files
committed
adjust refetch trigger
1 parent f150bad commit 2b22ee2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

site/src/modules/resources/AgentDevcontainerCard.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
152152
});
153153

154154
// Re-fetch containers when the subAgent changes to ensure data is
155-
// in sync.
155+
// in sync. This relies on agent updates being pushed to the client
156+
// to trigger the re-fetch. That is why we match on name here
157+
// instead of ID as we need to fetch to get an up-to-date ID.
156158
const latestSubAgentByName = subAgents.find(
157159
(agent) => agent.name === devcontainer.name,
158160
);
@@ -163,7 +165,12 @@ export const AgentDevcontainerCard: FC<AgentDevcontainerCardProps> = ({
163165
queryClient.invalidateQueries({
164166
queryKey: ["agents", parentAgent.id, "containers"],
165167
});
166-
}, [latestSubAgentByName, queryClient, parentAgent.id]);
168+
}, [
169+
latestSubAgentByName?.id,
170+
latestSubAgentByName?.status,
171+
queryClient,
172+
parentAgent.id,
173+
]);
167174

168175
const showDevcontainerControls = subAgent && devcontainer.container;
169176
const showSubAgentApps =

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy