Skip to content

Conversation

pokey
Copy link

@pokey pokey commented Sep 30, 2025

Fixes unreachable node error when using server-side tools (like Anthropic's code_execution, web_search, bash) with createAgent.

Previously, the tools node was created whenever ANY tools were passed, but only client tools (Runnables) need the tools node for local execution. Server tools (plain objects) are executed by the provider and return results in the message content, not as tool_calls.

Fixes # (issue)

Fixes unreachable node error when using server-side tools (like Anthropic's
code_execution, web_search, bash) with createAgent.

Previously, the tools node was created whenever ANY tools were passed, but
only client tools (Runnables) need the tools node for local execution.
Server tools (plain objects) are executed by the provider and return results
in the message content, not as tool_calls.
Copy link

changeset-bot bot commented Sep 30, 2025

⚠️ No Changeset found

Latest commit: 7dc487b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
langchainjs-docs Ready Ready Preview Sep 30, 2025 2:55pm

Copy link

vercel bot commented Sep 30, 2025

@pokey is attempting to deploy a commit to the LangChain Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, let's apply the same change, and integration test to the non-middleware agent.

@pokey
Copy link
Author

pokey commented Sep 30, 2025

Done. I just copied to test over ~verbatim. Is there a better way to do it?

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann merged commit 36cc3f6 into langchain-ai:v1 Sep 30, 2025
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants