tool_call_id_validationTier 1 · 70% confidence
ai-agents-tool-call-id-validat-when-using-create-tool-calling-agent-with-an-input-770eceae
agent: ai_agents
When does this happen?
IF When using create_tool_calling_agent with an InputChat model that includes ToolMessage in the Union type for chat_history, and the chat history contains messages without 'tool_call_id' (e.g., HumanMessage), a KeyError occurs during pydantic validation.
How others solved it
THEN Either remove the specific type hints from the chat_history field (use `List` without Union) or apply a custom validator. The root cause is in the ToolMessage validator expecting 'tool_call_id' unconditionally; a fix is to change `values["tool_call_id"]` to `values.get("tool_call_id")` in langchain_core/messages/tool.py. Updating the library is also recommended.
class InputChat(BaseModel):
chat_history: List = Field(..., description="The chat messages.")
input: strRelated patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.