AgentFixboard

ToolRuntime isn't injected when a tool has a custom args_schema

A @tool with args_schema set to a Pydantic model fails to receive its runtime argument (ToolRuntime or InjectedToolCallId).

From GitHub

langchain-ai/langchain

Difficulty
Easy
Time
~5 min
Steps
1
Fixed in
langchain-core==1.0.6
Last checked

Verified fix: PR #33999 merged on . Fixed in langchain-core==1.0.6 (first stable release containing the merge commit). Last checked .

Symptom

A @tool with args_schema set to a Pydantic model fails to receive its runtime argument (ToolRuntime or InjectedToolCallId).

Evidence what you'll see

  • Works without args_schema
  • Fails when args_schema doesn't list the injected argument

Cause

Injected arguments were only recognised if they appeared in the schema, so a custom schema without them dropped the injection.

Fix steps

0 of 1 done

Your check marks stay in this browser only.

Verify the fix worked

  • Call the tool and confirm runtime is populated while the other arguments are still validated by the schema.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it