Fix async injection tool-result ordering

This commit is contained in:
Hypatia May
2026-07-15 11:12:05 +08:00
parent 34bb75b2d2
commit 4ce32807e1
10 changed files with 104 additions and 55 deletions

View File

@@ -103,10 +103,11 @@ export interface Agent {
steer(content: ContentBlock[], options?: SendOptions): void
/**
* Append model-facing context without running the model. Idle injection uses
* a one-shot turn and durability checkpoint, while injection during an open
* turn joins it at the current log position. Disposal awaits idle checkpoints;
* flush failures are reported through `agent/error`, not thrown to the caller.
* Append detached model-facing context without running the model. An open-turn
* injection joins at the current log position unless tool results are pending,
* in which case it waits FIFO until the complete result batch is logged. Idle
* injection uses a one-shot turn and durability checkpoint. Disposal awaits
* idle checkpoints; flush failures report through `agent/error`.
*/
inject(content: ContentBlock[], options?: SendOptions): void