fix(ui): auto-navigate to run page and refresh runs list after invoke

After clicking Invoke on the agent detail page, the heartbeats query
is now invalidated so the runs list updates immediately. The existing
navigate logic also ensures you're taken to the new run's page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ForgottenandClaude Opus 4.6 committed 2026-02-23 20:08:12 -06:00
1 parent f4698b73de
commit 88855a6535
1 file changed
+1
+1
View File
@@ -289,6 +289,7 @@ export function AgentDetail() {
queryClient.invalidateQueries({ queryKey: queryKeys.agents.taskSessions(agentId!) });
if (selectedCompanyId) {
queryClient.invalidateQueries({ queryKey: queryKeys.agents.list(selectedCompanyId) });
queryClient.invalidateQueries({ queryKey: queryKeys.heartbeats(selectedCompanyId, agentId!) });
}
if (action === "invoke" && data && typeof data === "object" && "id" in data) {
navigate(`/agents/${agentId}/runs/${(data as HeartbeatRun).id}`);