fix(ui): fix config save button persisting after save on agent configure page

The parent query for agent detail uses routeAgentRef (URL key like
"claudecoder") in its cache key, but ConfigurationTab and rollbackConfig
only invalidated by agent.id (UUID). This meant the refetch never fired
when navigating by URL key, so the dirty overlay was never cleared and the
save button stayed visible indefinitely.

Add urlKey-based invalidation to match the pattern already used by other
mutations in the parent component.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dotta
2026-03-03 10:09:15 -06:00
parent c1f0b33d16
commit 8873dd793f

View File

@@ -1057,6 +1057,7 @@ function AgentConfigurePage({
mutationFn: (revisionId: string) => agentsApi.rollbackConfigRevision(agent.id, revisionId, companyId),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.id) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.urlKey) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.configRevisions(agent.id) });
},
});
@@ -1161,6 +1162,7 @@ function ConfigurationTab({
mutationFn: (data: Record<string, unknown>) => agentsApi.update(agent.id, data, companyId),
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.id) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agent.urlKey) });
queryClient.invalidateQueries({ queryKey: queryKeys.agents.configRevisions(agent.id) });
},
});