@tanstack/ai-bedrock
1.0.0 · 22 Oct 2026MIT38.3k / weekRepositorynpmAtom feed
Latest releases
All 38 releases- 1.x · latest line
1.0.0
22 Oct 2026- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
Major Changes
- breaking
TanStack AI 1.0.0. This release removes every API that was deprecated in 0.x. Read the upgrade guide before you upgrade: tanstack.com/ai/latest/docs/migration/v1
Removed all
@deprecatedexports, options, fields, and type aliases. Each one has a replacement that already shipped in 0.x.Removed
addToolApprovalResponse()fromChatClientand every chat hook. Resolve the boundtool-approvalinterrupt withresolveInterruptinstead. The devtools eventtools:approval:respondedis also removed.Removed the old wire formats: the CUSTOM
approval-requestedandtool-input-availableevents, the[DONE]SSE line, thedatacopy offorwardedProps, pre-binding interrupt descriptors and theirapproval_requiredandclient_tool_inputreasons, and the STEP events that adapters sent next toREASONING_*events. Use a 1.0 client with a 1.0 server.Removed the
toolNamealias fromTOOL_CALL_STARTchunks. ReadtoolCallNameinstead.threadIdis now required onuseChatand every other chat hook,ChatClient, the generation hooks and clients,chat(),summarize(), the generation functions,codeModeWithSnippets(),selectRelevantSnippets(),CompactionContext, andSummarizeInput. TanStack AI no longer makes a thread id for you. Pass a stable id for each conversation.createChatHookfactory options no longer takethreadId: pass it on each hook call. Octane generation hooks takethreadIdinstead ofid.@tanstack/ai-sandboxremovesresolveDurableThreadIdandDurableThreadIdRequiredError.The published
@tanstack/ai-octane/uitypes are now strict.UI.Messages,UI.Message,UI.Part, andUI.Interruptstype their render children.ToolPropstypespart.inputandpart.outputfor the named tool.toolsComponentsandinterruptsComponentsare required when the chat options declare tools or named interrupts. Code that relied on the old loose types can fail to compile.A connection adapter's
connect()andsend()need the run context (withthreadId) as their fourth argument.ChatClientand the generation clients pass it.@tanstack/ai-sandbox:createToolBridgeCore(),startHostToolBridge(), aToolBridgeProvisioner, andexecuteHostTool()take a requiredthreadId. Bridged tools get it in their context.@tanstack/ai-sandbox: the harness tool bridge andexecuteHostTool()refuse a tool withneedsApproval. Before, the tool ran with no approval. RemoveneedsApproval, or run the tool with an HTTP adapter.stream()andrpcStream()pass the AG-UIRunAgentInputfor the run as the fourth factory argument, the same body the HTTP adapters send. Read it on the server withchatParamsFromRequestBody()orgenerationParamsFromBody(), sothreadId,runId, and interruptresumereach a server function.RunAgentInputis exported from@tanstack/ai/client.A generation
fetchergetsthreadIdandrunIdin its second argument, next tosignalandheaders. Pass them to the server generation call.generationParamsFromBody()andgenerationParamsFromRequest()read the generation input fromforwardedProps. A server that readsbody.datagetsundefined. Readbody.forwardedPropsinstead. They also requirethreadIdandrunIdand return them as strings, the same aschatParamsFromRequestBody()and the AG-UIRunAgentInput. A body that holds only the input is rejected.Removed the readers for data saved in old 0.x formats (old Cloudflare run-log records, a bare
UIMessagefrom client persistence, artifact records withoutblobKey).Removed provider models that are shut down.
@tanstack/ai-react-ui,@tanstack/ai-solid-ui, and@tanstack/ai-vue-uiget no 1.0 release. Import from@tanstack/ai-react/ui,@tanstack/ai-solid/ui, or@tanstack/ai-vue/ui.
- 0.6.x · maintenance
0.6.2
21 Oct 2026Only updates dependencies:@tanstack/ai 0.71.0@tanstack/openai-base 0.16.0
0.6.1
19 Oct 2026Keep the provider's raw tool argument string for replay.
Patch Changes
Keep the provider's raw tool argument string for replay.
Adapters now send the raw argument string as
argsonTOOL_CALL_END.The tool call in the history keeps that exact string when it is the same JSON value as the parsed input, so the next request sends the provider's own bytes back (for example
1.50, or an id pastNumber.MAX_SAFE_INTEGER). When the parsed input differs, only the changed values are written again.The
TOOL_CALL_ENDthat reaches the client carries the same string inmetadata.tanstack.args, so the client history matches the server history. It no longer also carriesmetadata.tanstack.input: in-processchat()andStreamProcessorparseinputfromargs. Run the client and the server on the same release: an older client ignoresargs, so it builds the tool input from the streamed deltas only, and a tool call with no deltas (for example an Anthropic server tool) gets no input.History converters for Bedrock and the Gemini Interactions API send malformed tool arguments as
{}instead of failing the request.Gemini Interactions: the initial
step.argumentssnapshot goes out as aTOOL_CALL_ARGSdelta only when no argument deltas follow, so the deltas always add up to the final arguments.Malformed tool arguments are no longer turned into
{}by an adapter. The tool gets a "Failed to parse tool arguments as JSON" error that the model can repair. Mistral still ends the run with an error on malformed arguments, as before.
0.6.0
13 Oct 2026Text adapters now set one stable code on
RUN_ERRORwhen the input does not fit in the model's context window:code: 'context_overflow'.@tanstack/aiexports it asCONTEXT_OVERFLOW_CODE. The provider's own text stays inmessage.if (chunk.type === 'RUN_ERROR' && chunk.code === CONTEXT_OVERFLOW_CODE) { // shorten the messages, then call chat() again }These adapters set it: OpenAI and the other OpenAI-compatible adapters (from
code: 'context_length_exceeded'), Anthropic, Gemini, Bedrock (Converse, Chat Completions, and Responses), OpenRouter, Grok, Cloudflare Workers AI, and BytePlus.Changes to code that reads the old values:
Prompt caching is now on by default. Each
chat()call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.Set reasoning with
chat({ reasoning })on the three Bedrock APIs.Breaking:
reasoning_effort(Chat Completions) andreasoning(Responses) are no longer inmodelOptions.// Before chat({ adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }), messages, modelOptions: { reasoning_effort: 'high' }, }) // After chat({ adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }), messages, reasoning: 'high', })Structured output sends no thinking, because Claude cannot think while a tool is forced.
Minor Changes
Text adapters now set one stable code on
RUN_ERRORwhen the input does not fit in the model's context window:code: 'context_overflow'.@tanstack/aiexports it asCONTEXT_OVERFLOW_CODE. The provider's own text stays inmessage.if (chunk.type === 'RUN_ERROR' && chunk.code === CONTEXT_OVERFLOW_CODE) { // shorten the messages, then call chat() again }These adapters set it: OpenAI and the other OpenAI-compatible adapters (from
code: 'context_length_exceeded'), Anthropic, Gemini, Bedrock (Converse, Chat Completions, and Responses), OpenRouter, Grok, Cloudflare Workers AI, and BytePlus.Changes to code that reads the old values:
OpenAI-compatible adapters gave
code: 'context_length_exceeded'. They now give'context_overflow'.rawEventstill has the provider's code.Anthropic, Grok, OpenRouter, and BytePlus gave the HTTP status or a general bad-request code for this error. Gemini and Bedrock Converse gave no code.
The Anthropic adapter now sends
RUN_ERRORwith this code when the model stops withstop_reason: 'model_context_window_exceeded'. Before, it sentRUN_FINISHEDwithfinishReason: 'stop', so a cut-off answer looked complete.
Prompt caching is now on by default. Each
chat()call asks the provider to cache the stable start of the request (system prompt, tools, and earlier messages), so repeated requests cost less and answer sooner.New
chat()optionpromptCache:'none' | 'short' | 'long', or{ retention, key }. The default is'short'. The key ispromptCache.key, else thethreadIdorconversationIdthat you give. AthreadIdthatchat()makes up is never the key.To turn it off, pass
promptCache: 'none'. Do this for a large prompt that you send to Claude one time only, because Claude bills the cache write.A middleware can change it for the next model call:
onConfiggetsconfig.promptCacheand can return a new value.Each adapter sends its own fields:
Claude on Anthropic, Bedrock Converse, and OpenRouter gets cache markers.
'long'asks for the 1-hour TTL.OpenAI (Responses and Chat Completions) gets
prompt_cache_key, andprompt_cache_retentionorprompt_cache_optionson'long'.Mistral gets
prompt_cache_key, and usage now reports cache reads.OpenRouter gets
sessionId.
A manual
cache_control,cachePoint,prompt_cache_key, orsessionIdwins over the automatic value.New types:
PromptCacheRetention,PromptCacheOptions, andResolvedPromptCache. Adapters readTextOptions.promptCache.
Set reasoning with
chat({ reasoning })on the three Bedrock APIs.Chat Completions sends
reasoning_effort. Responses sendsreasoning.effort.Converse sends thinking only for Claude: budget thinking in
additionalModelRequestFieldswith the interleaved-thinking beta, andmaxTokensgrows past the budget. A model with effort levels gets adaptive thinking withoutput_config.effort.offsends nothing.The reasoning data is in
model-meta.ts, keyed by catalog id.BedrockModelReasoningByNameandBEDROCK_MODEL_REASONINGcome from it.
Breaking:
reasoning_effort(Chat Completions) andreasoning(Responses) are no longer inmodelOptions.// Before chat({ adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }), messages, modelOptions: { reasoning_effort: 'high' }, }) // After chat({ adapter: bedrockText('openai.gpt-oss-120b-1:0', { api: 'chat' }), messages, reasoning: 'high', })Structured output sends no thinking, because Claude cannot think while a tool is forced.
Patch Changes
The Bedrock text adapters (Converse, Chat Completions, and Responses) now set
inputModalitiesfrom the model catalog. Before, it was alwaysundefined. A known model gives the input kinds it reads, and an unknown model givesundefined.On the Responses API, this also means a text-only model such as
openai.gpt-oss-120b-1:0no longer gets image parts in a tool result, the same as other Responses adapters.The Bedrock Converse adapter now sends tool history as text when a chat request has no tools. Bedrock needs a
toolConfigfortoolUseandtoolResultblocks, so before this fix such a request failed with a 400 error. The saved messages do not change.The Bedrock Converse adapter now sends an inline tool-result image as a Converse image block on Amazon Nova and Anthropic Claude 3 and 4. Other models, URL images, and unsupported image types still send only the text. A tool result with only an image does not get an empty text block.
Keep a schema property or a tool argument named
__proto__. Before this fix, code that copied it without[key] = valuewent to the__proto__setter instead, so the key was lost.@tanstack/ai-utils:transformNullsToUndefinedandundoNullWideningkeep the key.@tanstack/openai-base: the strict schema and its null-widening map keep the key.@tanstack/ai-mistral: the null-widening map keeps the key.@tanstack/ai-openrouter: the Responses tool input normalizer keeps the key.@tanstack/ai-gemini: the Interactions adapter keeps the key in tool parameters.@tanstack/ai-bedrock: the Converse adapter puts the tool schemas and tool inputs back into the request body after the AWS SDK serializes it, because the SDK drops the key.
Keep a conversation valid when the next request goes to a different model.
Each assistant message records
metadata.tanstack.source({ provider, api, model }), andresponseIdand the resolvedmodelwhen the provider sends them. A failed or aborted answer getsstopReason: 'error'or'aborted'.RUN_FINISHEDhas a newresponseIdfield.TextAdapterhas new optionalproviderandapifields.When the next request goes to a different source, the adapter removes signatures and redacted thinking, turns readable thinking into text, and rewrites tool call IDs to the shape the target API accepts. Each call stays paired with its result.
Every request drops failed and aborted assistant batches and adds a
No result providedresult for an unanswered tool call. The saved history does not change.RUN_FINISHEDandRUN_ERRORmetadata now merge onto the assistant messages of that model call inStreamProcessor.Anthropic: the new
allowEmptySignatureoption (defaultfalse) replays unsigned thinking from the same source, for gateways. The newprovideroption names a gateway.Azure OpenAI reports the
azure-openai-responsesAPI.Gemini, Mistral, and Bedrock Converse send same-source thinking back to the model, in block order.
withPersistencewrites the source and the stop reason onto streaming snapshot rows.Adapter authors get
transformMessagesForReplay()andhashToolCallId()from@tanstack/ai/adapter-internals.
Send
chat({ toolChoice })to each provider.Anthropic and Bedrock Converse. Claude Fable 5.1, Mythos 5.1, Opus 5.5, and Sonnet 5.5 reject a forced tool, and every Claude model rejects one while thinking is on. On those,
'required'and a named tool fall back toauto.Bedrock Converse has no
none.'none'sends no tool config. Bedrock refuses tool calls in the history without a tool config, so the history goes out as text.Gemini maps the choice to
functionCallingConfig(AUTO,NONE,ANY, andallowedFunctionNames). With only provider tools, such as Google Search, it sends no tool config.OpenAI and Azure OpenAI (Responses), Grok, Mistral, and OpenRouter (Chat Completions and Responses) send their own
tool_choiceshape.
- 0.5.x · maintenance
0.5.1
9 Oct 2026Only updates dependencies:@tanstack/ai 0.68.0@tanstack/openai-base 0.13.1
Dependency tracking · free for 3 projects
Know when your own dependencies move
@tanstack/ai-bedrock shipped a new major in the last 12 months, among 38 releases. Inlinr shows which of your projects are behind, and what the upgrade breaks.
Advisories reach you
An email when a critical or high advisory affects a project, before the next install.
Upgrades checked first
Peer ranges, Node, ESM-only and types changes read before you bump.
Only what matters
Majors and breaking notes stay; patches and sibling bumps fold into one line.
Registry facts last checked 22 Oct 2026. Releases and advisories last read 23 Oct 2026.