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
Follow-up to #2226, split out of the review of #2263.
#2226 and #2263 treat this as a LangGraph bug, but the same one-line omission is present in several other first-party adapters: AG-UI's ToolMessage.error is never read when an incoming tool result is converted into the target framework's tool-result shape, so a client-reported tool failure is handed to the model as a success.
integrations/langchain/typescript — same fix as #2263, verbatim.src/messages.ts:46-51:
@langchain/core's ToolMessage has the same status: "success" | "error" field the LangGraph fix targets, and the same provider plumbing consumes it. This is a direct copy of #2263's change.
The Bedrock toolResult block accepts status: "success" | "error", and here it is pinned to "success" unconditionally — a failed frontend tool call is asserted to the model as having succeeded. Same shape of fix: "error" if getattr(msg, "error", None) else "success".
The same file's agui_messages_to_strands-style conversion at agent.py:198-208 also rebuilds an AG-UI ToolMessage without error, dropping the field on that path too.
integrations/vercel-ai-sdk/typescript (src/index.ts:271-281) and integrations/mastra/typescript (src/utils.ts:202-214) both build a tool-result part from toolCallId / toolName / result with no error signal at all. Whether these are fixable depends on the AI SDK version in use — v5's tool-result output supports an error-typed output — so they need a look rather than a copy-paste of the same patch.
Steps to Reproduce
Same as #2226, with the adapter swapped. For the LangChain TS adapter:
Convert an AG-UI ToolMessage with error set via integrations/langchain/typescript's message conversion.
Inspect the resulting ToolMessage.status.
It is "success" (the default); langchain_anthropic and friends then report is_error: false to the model.
Expected Behavior
Every first-party adapter that converts an AG-UI tool message into a framework tool result should carry the failure signal across when the target framework has a slot for it. error set ⇒ the framework's error flag set.
Additional Context
Worth deciding as a group rather than one PR per adapter, so the adapters do not diverge on the "does the errortext travel too?" question. The claude-managed-agents adapters already do carry it — integrations/claude-managed-agents/typescript/src/agent.ts:30-32 and integrations/claude-managed-agents/python/ag_ui_claude_managed_agents/agent.py:521-532 newline-join content + error into the result text and set is_error from bool(error) — so there is an in-repo precedent to standardize on.
Describe the Bug
Follow-up to #2226, split out of the review of #2263.
#2226 and #2263 treat this as a LangGraph bug, but the same one-line omission is present in several other first-party adapters: AG-UI's
ToolMessage.erroris never read when an incoming tool result is converted into the target framework's tool-result shape, so a client-reported tool failure is handed to the model as a success.integrations/langchain/typescript— same fix as #2263, verbatim.src/messages.ts:46-51:@langchain/core'sToolMessagehas the samestatus: "success" | "error"field the LangGraph fix targets, and the same provider plumbing consumes it. This is a direct copy of #2263's change.integrations/aws-strands/python— hardcoded success.src/ag_ui_strands/agent.py:234-243:The Bedrock
toolResultblock acceptsstatus: "success" | "error", and here it is pinned to"success"unconditionally — a failed frontend tool call is asserted to the model as having succeeded. Same shape of fix:"error" if getattr(msg, "error", None) else "success".The same file's
agui_messages_to_strands-style conversion atagent.py:198-208also rebuilds an AG-UIToolMessagewithouterror, dropping the field on that path too.integrations/vercel-ai-sdk/typescript(src/index.ts:271-281) andintegrations/mastra/typescript(src/utils.ts:202-214) both build atool-resultpart fromtoolCallId/toolName/resultwith no error signal at all. Whether these are fixable depends on the AI SDK version in use — v5'stool-resultoutput supports an error-typed output — so they need a look rather than a copy-paste of the same patch.Steps to Reproduce
Same as #2226, with the adapter swapped. For the LangChain TS adapter:
ToolMessagewitherrorset viaintegrations/langchain/typescript's message conversion.ToolMessage.status."success"(the default);langchain_anthropicand friends then reportis_error: falseto the model.Expected Behavior
Every first-party adapter that converts an AG-UI tool message into a framework tool result should carry the failure signal across when the target framework has a slot for it.
errorset ⇒ the framework's error flag set.Additional Context
errortext travel too?" question. Theclaude-managed-agentsadapters already do carry it —integrations/claude-managed-agents/typescript/src/agent.ts:30-32andintegrations/claude-managed-agents/python/ag_ui_claude_managed_agents/agent.py:521-532newline-joincontent+errorinto the result text and setis_errorfrombool(error)— so there is an in-repo precedent to standardize on.errorentirely, which is plausibly why adapter authors keep missing it.Environment