Skip to content

Conversation

starchou6
Copy link
Contributor

@starchou6 starchou6 commented Aug 31, 2025

Description: This PR fixes a bug where InjectedToolCallId injection would fail when an LLM generates the parameter that should be automatically injected. Previously, the injection logic would skip injection if the parameter was already present in the tool input, causing tools to receive LLM-generated fake IDs instead of the real tool call ID.

The fix removes the k not in tool_input condition check, ensuring that InjectedToolCallId parameters are always injected regardless of whether the LLM has already provided them. This maintains the intended behavior where injected parameters should always override any user-provided values.

Issue: Fixes #32729

Dependencies: None

@starchou6 starchou6 requested a review from eyurtsev as a code owner August 31, 2025 12:06
Copy link

vercel bot commented Aug 31, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchain Ignored Ignored Preview Aug 31, 2025 0:12am

Copy link

codspeed-hq bot commented Aug 31, 2025

CodSpeed WallTime Performance Report

Merging #32766 will not alter performance

Comparing starchou6:fix/injected-tool-call-id-injection-bug (bd16de0) with master (fcf7175)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Aug 31, 2025

CodSpeed Instrumentation Performance Report

Merging #32766 will not alter performance

Comparing starchou6:fix/injected-tool-call-id-injection-bug (bd16de0) with master (fcf7175)

Summary

✅ 14 untouched benchmarks

@mdrxy mdrxy added the core Related to the package `langchain-core` label Aug 31, 2025
@mdrxy mdrxy changed the title fix(core): ensure InjectedToolCallId always overrides LLM-generated values fix(core): ensure InjectedToolCallId always overrides LLM-generated values Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the package `langchain-core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InjectedToolCallId Injection Fails When LLM Generates Parameter
3 participants