Skip to content

Conversation

eyurtsev
Copy link
Collaborator

@eyurtsev eyurtsev commented Oct 21, 2025

The LLM shouldn't be seeing parameters it cannot control in the ToolMessage error it gets when it invokes a tool with incorrect args.

This fixes the behavior within langchain to address immediate issue.

We may want to change the behavior in langchain_core as well to prevent validation of injected arguments. But this would be done in a separate change

@github-actions github-actions bot added langchain Related to the package `langchain` v1 Issue specific to LangChain 1.0 fix labels Oct 21, 2025
@github-actions github-actions bot added fix and removed fix labels Oct 21, 2025
@sydney-runkle
Copy link
Collaborator

  • Changing how we inject args (where that happens) seems good ✅
  • It seems like the right way to do this is actually to just skip validation for injected args (so that issues would never show up in validation errors)

One concern that I have at the moment is, what if only state for example fails validation? We don't want to be hitting the error branch in that case at all... what's the lift like to change this in core instead?

@eyurtsev
Copy link
Collaborator Author

| It seems like the right way to do this is actually to just skip validation for injected args (so that issues would never show up in validation errors)

Yeah -- this is the work in langchain_core. Let me know what you discover. Splitting into 2 separate PRs

@eyurtsev eyurtsev marked this pull request as ready for review October 21, 2025 19:24
@eyurtsev eyurtsev merged commit 17f0716 into master Oct 21, 2025
37 checks passed
@eyurtsev eyurtsev deleted the eugene/fix_tool_message_error branch October 21, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix langchain Related to the package `langchain` v1 Issue specific to LangChain 1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants