Improve in-flight cancel latency via run abort signal propagation

This commit is contained in:
William Valentin
2026-02-19 12:24:39 -08:00
parent 290303c14e
commit 2c3a00f6dd
12 changed files with 148 additions and 20 deletions
+1
View File
@@ -700,6 +700,7 @@ Cancel the current agent operation.
Used by the web dashboard/chat stop button and channel-level `/stop` / `/cancel` command fast-paths.
Cancellation is best-effort and stops at the next agent/tool-loop safe point.
Flynn now propagates a run-level abort signal into model/tool execution, so providers/tools that honor `AbortSignal` typically stop promptly instead of waiting for request/tool timeouts.
### Node Methods
+2
View File
@@ -68,6 +68,8 @@ export interface ToolExecutionContext {
}
```
`signal` is wired to run-level cancellation (`agent.cancel`, `/stop`, `/cancel`) and tool timeout. Tools should honor it for fast cooperative aborts.
### ToolResult
```typescript