From 260d525686dee95f68dcadb11d2a4e8d05c61c8a Mon Sep 17 00:00:00 2001 From: Forgotten Date: Fri, 20 Feb 2026 12:21:03 -0600 Subject: [PATCH] Navigate to run page after invoking heartbeat on agent detail When clicking Invoke on the agent page, after the run is created the browser now navigates to /agents/{id}/runs/{runId} so the user can immediately see the live run. Co-Authored-By: Claude Opus 4.6 --- ui/src/pages/AgentDetail.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsx index d2981629..73c96e87 100644 --- a/ui/src/pages/AgentDetail.tsx +++ b/ui/src/pages/AgentDetail.tsx @@ -229,7 +229,7 @@ export function AgentDetail() { case "terminate": return agentsApi.terminate(agentId); } }, - onSuccess: () => { + onSuccess: (data, action) => { setActionError(null); queryClient.invalidateQueries({ queryKey: queryKeys.agents.detail(agentId!) }); queryClient.invalidateQueries({ queryKey: queryKeys.agents.runtimeState(agentId!) }); @@ -237,6 +237,9 @@ export function AgentDetail() { if (selectedCompanyId) { queryClient.invalidateQueries({ queryKey: queryKeys.agents.list(selectedCompanyId) }); } + if (action === "invoke" && data && typeof data === "object" && "id" in data) { + navigate(`/agents/${agentId}/runs/${(data as HeartbeatRun).id}`); + } }, onError: (err) => { setActionError(err instanceof Error ? err.message : "Action failed");