Skip to content

The open-source app everyone uses to manage agents at work

Navigate to run page after invoking heartbeat on agent detail

Forgotten260d525686de
diff --git a/ui/src/pages/AgentDetail.tsx b/ui/src/pages/AgentDetail.tsx
index d298162993..73c96e8792 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");