Files
tai/research/cap-protocol/acp-cancellation.md
T

48 lines
1.9 KiB
Markdown
Raw Normal View History

# ACP cancellation ($/cancel_request, -32800)
## Metadata
| Field | Value |
|---|---|
| Institute | Molodetz Institute — Research & Retrieval Division |
| Subject | cap-protocol |
| Document type | Source Dossier |
| Tier | 1 |
| Source title | ACP Cancellation |
| Source URL | https://agentclientprotocol.com/protocol/v1/cancellation.md |
| Source type | specification |
| Source date (published) | Unknown, not stated (living docs) |
| Date researched | 2026-10-18 |
| Researched by | tai (agent), model: Muse Spark, on behalf of retoor |
| Research method | direct page fetch, read in full (75 lines) |
| Confidence | High |
| Status | Active |
## Summary
`$/cancel_request` notification cancels any JSON-RPC request; the callee MUST answer the original request (valid response or `-32800` Request Cancelled). Prompt turns ALSO have `session/cancel`, under which the client MUST answer pending permission requests with `cancelled` and the agent MUST end the prompt with stop reason `cancelled`.
## Key findings
- Two-level cancel: generic `$/cancel_request` for any request, plus turn-scoped `session/cancel` with stricter MUSTs; tai's driver needs both (turn cancel maps from `cap.cancel` scope current_turn).
- Cascading cancel is illustrated but explicitly optional: no automatic propagation guarantee.
- Internal cancellation (either side) SHOULD surface as the same `-32800`, keeping one code path.
## Pros / strengths
- Clean separation of generic vs turn cancel; the worked cascade example removes sequencing doubt.
## Cons / limitations / caveats
- `$/cancel_request` support is optional per implementation; tai must handle agents that ignore it (timeout + kill).
## Relevance to tai
Cancel mapping for the ACP driver: `cap.cancel` to `session/cancel` (+ `$/cancel_request` for in-flight requests), with timeout fallback.
## Changelog
| Date | Change |
|---|---|
| 2026-10-18 | Initial dossier created. |