{"version":"2.1.246","anchor":"plugins-can-abort-the-current-turn-with-turn-abort","canonical_anchor":"plugins-can-abort-the-current-turn-with-turn-abort","heading":"Plugins can abort the current turn with $.turn.abort","tier":"use","area":"Plugins","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246\/e\/plugins-can-abort-the-current-turn-with-turn-abort","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.246","markdown":"### Plugins can abort the current turn with `$.turn.abort`\n\nPlugins get a new turn object whose abort verb ends the running turn with its own interrupt wording.\n\n**What**\n\nPlugin function hooks can now end the turn in progress through a new `turn` object on the plugin API surface, sitting alongside the existing `tool`, `agent`, `fs`, `store` and `clock` objects. Any tool call still running when the abort lands comes back as the synthetic result \"[Request interrupted by a plugin for tool use]\", which is distinct from the wording used when a person rejects a tool. Its only verb is `abort`, and it needs the turn id that the plugin was handed when the turn began.\n\n**Details**\n\n- `turn.start` now carries a turn id and an abort callback, and a hook passes that id back as `$.turn.abort({ turnId })`; calling it without the id rejects with an error.\n- The interrupted tool result is recorded with denial kind `interrupted`, not the user-rejected kind.\n- The turn's controller is aborted with a new cancellation reason, `turn-abort`, which is included in the sets that treat an interruption as user-initiated.\n- Misuse produces `$.turn.abort: no turn is running` or `$.turn.abort: <id> is already ending`.\n- Rate limited to one abort per 2000ms per plugin and 50 aborts per session.\n- The `turn` object is registered unconditionally for any plugin using function hooks, with no feature gate around it; a separate helper restricts a differently named object, `flag`, to internal builds only, so that one is present but off in this build.\n\n**Evidence**\n\n`[Request interrupted by a plugin for tool use]`, `$.turn.abort takes { turnId } (the id turn.start carried)`\n\n- Area: Plugins\n- Names: `$.turn.abort`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 4\/5"}