fix(agent-loop): harden lifecycle edge cases
This commit is contained in:
5 files changed
+167
-21
No files matched your search
@@ -82,11 +82,12 @@ export interface Agent {
|
||||
|
||||
/**
|
||||
* Resolve once the agent has reached quiescence after settling out of
|
||||
* `running`, or immediately if it is already idle. The quiescence signal a
|
||||
* teardown awaits: `agent.abort()` then `await agent.whenIdle()` guarantees
|
||||
* the in-flight turn has fully stopped before the caller proceeds (a closing
|
||||
* ACP connection, a disposing UI plugin), rather than returning while the
|
||||
* driver is still streaming.
|
||||
* `running`, or immediately if it is already idle with no queued work. The
|
||||
* quiescence signal a teardown awaits: `agent.abort()` then
|
||||
* `await agent.whenIdle()` guarantees queued/running work has fully stopped
|
||||
* before the caller proceeds (a closing ACP connection, a disposing UI
|
||||
* plugin), rather than returning while the driver is still streaming or about
|
||||
* to start a queued turn.
|
||||
*
|
||||
* "Quiescence", not merely "status changed": a disposed agent emits
|
||||
* `agent/status('disposed')` from inside its disposer, BEFORE the driver loop
|
||||
|
||||
Reference in New Issue
Block a user