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:
@@ -0,0 +1,18 @@
|
||||
package com.cameleer3.server.app.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "Request to replay an exchange on an agent")
|
||||
public record ReplayRequest(
|
||||
@NotNull @Schema(description = "Camel route ID to replay on")
|
||||
String routeId,
|
||||
@Schema(description = "Message body for the replayed exchange")
|
||||
String body,
|
||||
@Schema(description = "Message headers for the replayed exchange")
|
||||
Map<String, String> headers,
|
||||
@Schema(description = "Exchange ID of the original execution being replayed (for audit trail)")
|
||||
String originalExchangeId
|
||||
) {}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.cameleer3.server.app.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "Result of a replay command")
|
||||
public record ReplayResponse(
|
||||
@Schema(description = "Replay outcome: SUCCESS or FAILURE")
|
||||
String status,
|
||||
@Schema(description = "Human-readable result message")
|
||||
String message,
|
||||
@Schema(description = "Structured result data from the agent (JSON)")
|
||||
String data
|
||||
) {}
|
||||
Reference in New Issue
Block a user