Minor Changes
-
#1456
787e73dThanks @mattzcarey! - Stop applyingpruneMessages({ toolCalls: "before-last-2-messages" })to the model context by default. The previous default silently stripped client-side tool results (noexecute, output supplied viaaddToolOutput) from any turn beyond the second, breaking multi-turn flows where the user's choices live in those tool results (see #1455).truncateOlderMessagesstill runs as before, so context cost stays bounded.This is a behavior change. Subclasses that relied on the old aggressive pruning can opt back in from
beforeTurn:import { pruneMessages } from "ai"; beforeTurn(ctx) { return { messages: pruneMessages({ messages: ctx.messages, toolCalls: "before-last-2-messages" }) }; }
-
#1517
449b421Thanks @threepointone! - WrapThink.chat()RPC turns in chat recovery fibers and persist their stream chunks so interrupted sub-agent turns can recover partial output.ChatOptions.toolshas been removed from the TypeScript API; runtimeoptions.toolsvalues passed by legacy callers are ignored with a warning. Define durable tools on the child agent or use agent tools for orchestration. -
#1511
bf3860cThanks @threepointone! - Add durable programmatic submissions for Think.submitMessages()now provides fast durable acceptance, idempotent retries, status inspection, cancellation, and cleanup for server-driven turns that should continue after the caller returns.
Patch Changes
-
#1500
7090e9eThanks @threepointone! - Preserve structured tool output shapes when truncating older messages or oversized persisted rows, preventing customtoModelOutputhandlers from crashing or mis-replaying compacted results.Also harden Think's workspace
readtool so legacy raw-string read outputs replay as text instead of stalling subsequent turns. -
#1483
5373f5cThanks @whoiskatrin! - Allow Think agent-tool children to complete without emitting assistant text. Non-chat tool-step agents can now provide structured output throughgetAgentToolOutput, with summaries derived from assistant text, string output, structured output, or an empty string.Fix
useAgentChat().isServerStreamingcleanup when a resumed stream first enters the fallback observer path and later becomes transport-owned. -
#1463
ab2b1dbThanks @whoiskatrin! - Avoid throwing when chat stream resume negotiation/replay races with a closed WebSocket connection. Resume protocol sends and the_handleStreamResumeAckfallback now go throughsendIfOpenhelpers that swallow theTypeError: WebSocket send() after closerace instead of letting it propagate up throughonMessage.