feat: synchronous replay endpoint with agent response status
Add dedicated POST /agents/{id}/replay endpoint that uses
addCommandWithReply to wait for the agent ACK (30s timeout).
Returns the actual replay result (status, message, data) instead
of just a delivery confirmation.
Frontend toast now reflects the agent's response: "Replay completed"
on success, agent error message on failure, timeout message if the
agent doesn't respond.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -57,8 +57,12 @@ export function RouteControlBar({ application, routeId, hasRouteControl, hasRepl
|
||||
replayExchange.mutate(
|
||||
{ agentId, routeId, headers, body: inputBody ?? '', originalExchangeId: exchangeId },
|
||||
{
|
||||
onSuccess: () => {
|
||||
toast({ title: 'Replay sent', description: `${routeId} on ${agentId}`, variant: 'success' });
|
||||
onSuccess: (result) => {
|
||||
if (result.status === 'SUCCESS') {
|
||||
toast({ title: 'Replay completed', description: result.message ?? `${routeId} on ${agentId}`, variant: 'success' });
|
||||
} else {
|
||||
toast({ title: 'Replay failed', description: result.message ?? 'Agent reported failure', variant: 'error' });
|
||||
}
|
||||
setSendingAction(null);
|
||||
},
|
||||
onError: (err) => {
|
||||
|
||||
Reference in New Issue
Block a user