You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(chat): publish the agent options for hydrateMessages agents, and align the Head Start docs
chat.toStreamTextOptions() read the agent-level system, registry, cacheControl
and systemProviderOptions from a key set only inside the snapshot boot block,
which a hydrateMessages agent skips, so the spread form dropped them there.
The key is set on every boot now, with a test for the hydrateMessages case.
Docs: the actions gating example returns chat.turn() instead of a streamText
call onAction no longer receives; the extracted-loop examples import
ChatStreamText, stepCountIs and ModelMessage; the Head Start pages and the
chat-server docstrings list prompt among the owned options and describe
tools as caller-supplied.
If you have a [human-in-the-loop](/ai-chat/patterns/human-in-the-loop) tool waiting on `addToolOutput`, you usually want to refuse competing actions like `regenerate` until the answer arrives. [`chat.history.getPendingToolCalls()`](/ai-chat/backend#chat-history) gives you exactly that signal:
Copy file name to clipboardExpand all lines: docs/ai-chat/backend.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,9 +90,9 @@ If the managed prompt names a model, pass a registry on the agent so the runtime
90
90
For complex agent flows where `streamText` is called deep inside your code, use `chat.pipe()`. It works from **anywhere inside a task** — even nested function calls.
You bring `model`, `system`, `providerOptions`, `prepareStep`, anything else `streamText` accepts. Note that `tools` is the one owned key you do pass, since the SDK cannot know your schema-only set.
653
+
You bring `model`, `system`, `providerOptions`, `prepareStep`, anything else `streamText` accepts. `tools` is yours too: pass your schema-only set to the callback's `streamText` (or to `chat.toStreamTextOptions({ tools })`), since the SDK cannot know it.
0 commit comments