Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Broker inbound delivery now uses one per-agent queue so `auto_inject` and `manual_flush` handle ordering consistently.
- Inbound delivery APIs use `/delivery-mode` with `auto_inject` and `manual_flush` names before their first release.
- CLI attach commands share SDK-backed broker snapshots, delivery mode changes, streams, and flushes.
- PTY terminal query replies use the live VT grid, so cursor-position responses reflect the actual screen.
Expand Down
15 changes: 8 additions & 7 deletions src/listen_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ pub enum ListenApiRequest {
reply: tokio::sync::oneshot::Sender<Result<SetInboundDeliveryModeOk, DeliveryRouteError>>,
},
/// `GET /api/spawned/{name}/pending` — snapshot the per-worker
/// pending-message queue (FIFO, head first).
/// pending-message queue (FIFO, head first). Auto-inject workers usually
/// report an empty queue because they drain in the same broker turn.
GetPending {
name: String,
reply: tokio::sync::oneshot::Sender<Result<Vec<PendingRelayMessage>, DeliveryRouteError>>,
Expand Down Expand Up @@ -1165,11 +1166,11 @@ async fn listen_api_snapshot(
}

// ---------------------------------------------------------------------------
// Inbound delivery mode (per-agent inject vs. queue, plus pending-queue inspection)
// Inbound delivery mode (per-agent drain policy plus pending-queue inspection)
//
// The broker keeps an `InboundDeliveryMode` per worker; `manual_flush`
// mode parks inbound relay messages in a FIFO `pending` queue instead
// of injecting them.
// The broker keeps an `InboundDeliveryMode` per worker. All inbound relay
// messages pass through a FIFO `pending` queue; `auto_inject` drains it
// immediately, while `manual_flush` parks messages until the caller flushes.
// These four routes are the server-side surface the `agent-relay drive`
// client calls to flip modes, inspect the queue, and drain it.
// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -1256,8 +1257,8 @@ async fn listen_api_set_inbound_delivery_mode(
}

/// `GET /api/spawned/{name}/pending` → `{ "pending": [ ... ] }`, FIFO
/// (head of queue first). Empty array when the worker is not in
/// `manual_flush` delivery mode or simply has no pending messages.
/// (head of queue first). In `auto_inject` mode this is normally empty because
/// inbound messages drain in the same broker turn.
async fn listen_api_get_pending(
axum::extract::State(state): axum::extract::State<ListenApiState>,
axum::extract::Path(name): axum::extract::Path<String>,
Expand Down
Loading
Loading