Follow-up from PR #1750 review (issue #1603).
The broker's hosted agent_exited durable outbox (crates/broker/src/runtime/event_loop.rs) now carries a deterministic dedupe_key (agent_name::generation) into the JSON payload it POSTs to Relaycast's /v1/agents/:name/events endpoint, and only marks its own on-disk crash record Delivered after that HTTP call is confirmed successful (with a small bounded in-process retry on timeout/5xx, and full broker-restart replay as the fallback for anything that outlives those retries).
That gives the client a stable idempotency key a consumer could use to discard a duplicate, but EmitSessionEventRequest (the external Relaycast SDK request type consumed via RelayCast::emit_agent_event, out of this repo) has no idempotency-key parameter, and Relaycast's HTTP API has no documented server-side dedupe behavior keyed on any field in the payload today.
This means:
- A broker restart can legitimately replay an already-delivered exit (if the success write raced a crash) and Relaycast will durably record it twice, since nothing on the server discards it.
- Any hosted consumer reading Relaycast's agent-event log must dedupe using
payload.dedupe_key itself; the delivery guarantee is at-least-once, not exactly-once, until Relaycast's API gains real server-side idempotency.
Ask: either (a) extend the Relaycast HTTP API / SDK request type to accept and honor an idempotency key on POST /v1/agents/:name/events, or (b) explicitly document today's at-least-once contract for hosted agent_exited consumers so none of them assume exactly-once today.
Follow-up from PR #1750 review (issue #1603).
The broker's hosted
agent_exiteddurable outbox (crates/broker/src/runtime/event_loop.rs) now carries a deterministicdedupe_key(agent_name::generation) into the JSON payload it POSTs to Relaycast's/v1/agents/:name/eventsendpoint, and only marks its own on-disk crash recordDeliveredafter that HTTP call is confirmed successful (with a small bounded in-process retry on timeout/5xx, and full broker-restart replay as the fallback for anything that outlives those retries).That gives the client a stable idempotency key a consumer could use to discard a duplicate, but
EmitSessionEventRequest(the external Relaycast SDK request type consumed viaRelayCast::emit_agent_event, out of this repo) has no idempotency-key parameter, and Relaycast's HTTP API has no documented server-side dedupe behavior keyed on any field in the payload today.This means:
payload.dedupe_keyitself; the delivery guarantee is at-least-once, not exactly-once, until Relaycast's API gains real server-side idempotency.Ask: either (a) extend the Relaycast HTTP API / SDK request type to accept and honor an idempotency key on
POST /v1/agents/:name/events, or (b) explicitly document today's at-least-once contract for hostedagent_exitedconsumers so none of them assume exactly-once today.