{"slug": "interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0", "title": "Interrupt the LLM, keep the chat: turn-scoped cancellation (v1.22.0)", "summary": "Loom SDK v1.22.0 introduces turn-scoped cancellation, allowing users to stop an in-flight model generation and its tool calls while preserving the session, transcript, and context. The update adds new SSE frames, gRPC and HTTP endpoints, and front-end support via the Esc key, alongside model pattern auto-tracking and bundled chat agents with HTTP tools.", "body_md": "RFC BH splits stop-the-turn from stop-the-run. POST /v1/runs/{run_id}/cancel {reason?} stops the current turn of an interactive run (the in-flight model generation plus the tool calls it started) and parks it at awaiting_input with the session, transcript, and context intact — instead of throwing the session away like whole-run cancel did. The loop keeps the partial output and synthesizes cancelled-by-operator tool_results for any in-flight tool_use so the next turn's history stays valid. Run-cancel vs. turn-cancel is double-guarded on ctx.Err() plus the ErrTurnCancelled cause. A new turn_cancelled SSE frame distinct from the run-level cancelled. Interruption decline: a pending Question can be resolved with disposition:\"declined\" so the agent proceeds without an answer. Cross-replica routing by runs.replica_id (new internal/turncancel registry + coord.TurnCancelCoordinator). Every transport: gRPC CancelTurn + ResolveInterrupt RPCs, @loomcycle/client cancelTurn / cancelInterrupt, Python cancel_turn / resolve_interrupt / cancel_interrupt; HTTP + gRPC share extracted connector cores. LoomBoard's Esc key was the front-end driver. Also folded in: RFC BG P1 model_pattern for auto-tracking a model family (claude-haiku-*), and bundled chat agents gaining the HTTP tool.", "url": "https://wpnews.pro/news/interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0", "canonical_source": "https://loomcycle.dev/blog/interrupt-the-llm-keep-the-chat.html", "published_at": "2026-07-16 12:00:00+00:00", "updated_at": "2026-07-17 06:34:30.692393+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models"], "entities": ["Loom SDK", "LoomBoard", "gRPC", "HTTP"], "alternates": {"html": "https://wpnews.pro/news/interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0", "markdown": "https://wpnews.pro/news/interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0.md", "text": "https://wpnews.pro/news/interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0.txt", "jsonld": "https://wpnews.pro/news/interrupt-the-llm-keep-the-chat-turn-scoped-cancellation-v1-22-0.jsonld"}}