docs(agent,ai): clarify non-throwing stream and hook contracts

This commit is contained in:
Mario Zechner
2026-03-13 22:54:41 +01:00
parent ea1a1f8266
commit 4aa25bfb72
2 changed files with 20 additions and 1 deletions

View File

@@ -98,6 +98,8 @@ export interface AgentLoopConfig extends SimpleStreamOptions {
* these messages are added to the context before the next LLM call.
*
* Use this for "steering" the agent while it's working.
*
* Contract: must not throw or reject. Return [] when no steering messages are available.
*/
getSteeringMessages?: () => Promise<AgentMessage[]>;
@@ -109,6 +111,8 @@ export interface AgentLoopConfig extends SimpleStreamOptions {
* continues with another turn.
*
* Use this for follow-up messages that should wait until the agent finishes.
*
* Contract: must not throw or reject. Return [] when no follow-up messages are available.
*/
getFollowUpMessages?: () => Promise<AgentMessage[]>;
}