Description
When an inbound Relaycast delivery reaches a worker in manual_flush mode, the broker stores it only in the in-memory pending queue but immediately sends a cumulative delivery.ack.
If the broker exits before the queue is flushed, the pending message disappears. Relaycast has already terminalized the delivery and marked it read, so it is excluded from reconnect replay. The message is silently lost.
This crosses the durability boundary too early: accepted into a volatile local queue is currently treated as durably surfaced.
Steps to Reproduce
- Connect a Relay broker to Relaycast and register a worker.
- Set the worker to
manual_flush through PUT /api/spawned/{name}/delivery-mode.
- Send the worker a message through Relaycast.
- Confirm
GET /api/spawned/{name}/pending contains the message.
- Observe that the broker has already emitted
delivery.ack { up_to_seq: N }.
- Terminate the broker before calling
/flush.
- Restart and reconnect the broker with the same agent identity.
- Observe that the local pending queue is empty and Relaycast does not replay sequence N because it is already terminal and read.
A deterministic integration test can reproduce this by recreating broker state after step 5 and invoking Relaycast reconnect replay.
Expected Behavior
A Relaycast delivery is not cumulatively acknowledged until either:
- it has been successfully injected into the worker, or
- it has been committed to broker-owned storage that survives process failure and is restored before reconnect.
Actual Behavior
The delivery is acknowledged while its only actionable copy is in broker memory. A broker crash, restart, or queue eviction can permanently discard it.
Impact
This is silent message loss in a mode specifically intended to hold messages for later delivery. Relaycast also marks the message read, so normal inbox and replay mechanisms cannot repair the loss.
Evidence
handle_fleet_deliver treats any successful surface_fleet_deliver result as delivered, commits the local cursor, and emits the cumulative ACK:
For manual_flush, surface_fleet_deliver returns Ok(()) immediately after appending to delivery_states; no PTY injection or durable write has occurred:
The broker documents that delivery mode and its pending queue have no disk persistence:
On receipt of the ACK, Relaycast advances the persistent cursor, changes the rows to acked, and marks their messages read. Reconnect replay then excludes the delivery:
Environment
Acceptance Criteria
Related
Description
When an inbound Relaycast delivery reaches a worker in
manual_flushmode, the broker stores it only in the in-memory pending queue but immediately sends a cumulativedelivery.ack.If the broker exits before the queue is flushed, the pending message disappears. Relaycast has already terminalized the delivery and marked it read, so it is excluded from reconnect replay. The message is silently lost.
This crosses the durability boundary too early: accepted into a volatile local queue is currently treated as durably surfaced.
Steps to Reproduce
manual_flushthroughPUT /api/spawned/{name}/delivery-mode.GET /api/spawned/{name}/pendingcontains the message.delivery.ack { up_to_seq: N }./flush.A deterministic integration test can reproduce this by recreating broker state after step 5 and invoking Relaycast reconnect replay.
Expected Behavior
A Relaycast delivery is not cumulatively acknowledged until either:
Actual Behavior
The delivery is acknowledged while its only actionable copy is in broker memory. A broker crash, restart, or queue eviction can permanently discard it.
Impact
This is silent message loss in a mode specifically intended to hold messages for later delivery. Relaycast also marks the message read, so normal inbox and replay mechanisms cannot repair the loss.
Evidence
handle_fleet_delivertreats any successfulsurface_fleet_deliverresult as delivered, commits the local cursor, and emits the cumulative ACK:handle_fleet_deliverFor
manual_flush,surface_fleet_deliverreturnsOk(())immediately after appending todelivery_states; no PTY injection or durable write has occurred:surface_fleet_deliverThe broker documents that delivery mode and its pending queue have no disk persistence:
WorkerDeliveryStateOn receipt of the ACK, Relaycast advances the persistent cursor, changes the rows to
acked, and marks their messages read. Reconnect replay then excludes the delivery:ackDeliveriesUpToSeqdeliverPendingToNodeEnvironment
mainat58ec87cc2699877fe5bf3b8c54a38be13504e0bemainate905f3acfb790279ee2eb964cf711f29de87f718Acceptance Criteria
manual_flushsurvives broker restart or remains replayable from Relaycast.deliver -> manual queue -> broker restart -> reconnect/replay -> flush.Related
new/view/drive/relayCLI primitives for the broker-owned agent model #864