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 <noreply@anthropic.com>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user