Client-initiated cancellation of the connection's in-flight agent turn (the "Stop button"). Aborts the running send_message turn: the server drops the turn future at its next await point, abandoning the in-flight LLM/tool call, and replies with a terminal cancelled event. Correlation convention: send the SAME requestId as the send_message being cancelled, so the cancelled event echoes it. A connection runs at most ONE turn at a time; a cancel with no active turn is a harmless no-op that emits nothing.
Dispatched by the Rust server, and present as its own schema file — but missing from the envelope schema’s hand-maintained action enum. Generators that read only the envelope will not know this verb exists.
| Field | Type | Meaning |
|---|---|---|
action* | "cancel" | Action discriminator. |
requestId | string | The requestId of the in-flight send_message turn to cancel. Echoed back on the cancelled event so the client correlates the reset. |
sessionId | string | Optional, advisory. The server cancels the connection's single active turn; a per-connection socket carries one turn at a time. |