A host supports both stdio and Streamable HTTP servers. When the user cancels an in-flight tools/call, how should the client signal cancellation on each transport under revision 2026-07-28?
Select an answer to reveal the explanation.
Short Explanation
On HTTP every request gets its own phone line, so you just hang up that line. On stdio everyone shares one line, so you have to say out loud which request you're cancelling. The trap is mixing those up.
Full Explanation
Cancellation in 2026-07-28 depends on the transport. On Streamable HTTP each request has its own response stream, so closing that stream is the cancellation signal; the server must treat the client disconnect as cancellation and must not send further messages for that request, and no notifications/cancelled message is required or expected. On stdio there is no per-request stream to close, so the client must send notifications/cancelled referencing the request ID, optionally with a reason. Sending notifications/cancelled on both transports and waiting for an error misreads the design twice: HTTP does not use the notification, and cancellation is fire-and-forget with no reply, so the server should simply stop and not respond. Closing stdin on stdio is the shutdown procedure that ends the entire server process, not a single request, and HTTP DELETE belonged to session termination, which was removed; a modern-only server answers DELETE with 405. The mirrored pairing puts each mechanism on the wrong transport, since stdio has no per-request stream and HTTP needs no cancellation notification. Exam caveat: cancellation races are normal, and the client should ignore any late response to a cancelled request. Operational check: cancel a slow tool on each transport and confirm the server stops work and logs the cancellation.