interrupt() affects the current turn. close() disposes the iterator and
transient Session and is idempotent. Session startup is lazy.
Example
Extends
AsyncGenerator<AgentMessage,ResultMessage,void>
Methods
close()
Returns
Promise<void>
A promise settled after owned resources are handled.
Throws
When one or more teardown stages fail.Example
interrupt()
Returns
Promise<void>
A promise settled after the abort request.
Throws
When startup or the abort request fails.Example
sessionId()
Returns
Promise<string>
The transient server session id.
Throws
When session creation fails or the stream is already closed.Example
setModel()
Parameters
model
ModelId
New provider/model id.
Returns
Promise<void>
A promise settled after the server applies the model.
Throws
When the stream is closed, the id is invalid, or the request fails.Example
setPermissionMode()
Parameters
mode
PermissionMode
New runtime permission mode.
Returns
Promise<void>
A promise settled after the server applies the mode.