fix: expose abort signal to extensions closes #2660
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- Added `Agent.signal` to expose the active abort signal for the current turn, allowing callers to forward cancellation into nested async work ([#2660](https://github.com/badlogic/pi-mono/issues/2660))
|
||||
|
||||
## [0.63.1] - 2026-03-27
|
||||
|
||||
## [0.63.0] - 2026-03-27
|
||||
|
||||
@@ -371,6 +371,11 @@ export class Agent {
|
||||
this._state.messages = [];
|
||||
}
|
||||
|
||||
/** The current abort signal, or undefined when the agent is not streaming. */
|
||||
get signal(): AbortSignal | undefined {
|
||||
return this.abortController?.signal;
|
||||
}
|
||||
|
||||
abort() {
|
||||
this.abortController?.abort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user