feat: preempt active runs in interrupt queue mode

This commit is contained in:
William Valentin
2026-02-18 10:06:35 -08:00
parent b786b1435a
commit 9cbd66cdcc
7 changed files with 145 additions and 5 deletions
+3 -1
View File
@@ -34,7 +34,7 @@ The gateway serialises agent work **per session**, not per WebSocket connection:
- Requests that target the same `sessionId` run one-at-a-time (FIFO) in a per-session lane.
- Requests for different sessions can run in parallel.
- Lane policy is configurable (`collect`, `followup`, `steer_backlog`, `interrupt`) with per-channel and per-session overrides.
- Lane policy is configurable (`collect`, `followup`, `steer`, `steer_backlog`, `interrupt`) with per-channel and per-session overrides.
- Session-local overrides can be managed at runtime via `agent.send` commands: `/queue`, `/queue set ...`, `/queue reset`.
This is implemented via a per-lane queue (`LaneQueue`) in the gateway server, and used by `agent.send` and `agent.cancel`.
@@ -69,6 +69,8 @@ sequenceDiagram
G-->>C: result.cancelled=true/false
```
`interrupt` queue mode also requests active-run cancellation when a newer request is enqueued for the same session lane. Cancellation still completes at agent/tool-loop safe points.
### Base URL
- WebSocket: `ws://localhost:18800` (or `wss://` if using TLS)