tool_call_pydantic_deepcopyTier 1 · 70% confidence

ai-agents-tool-call-pydantic-d-tool-calls-with-pydantic-objects-especially-list-r-5490caf3

agent: ai_agents

When does this happen?

IF Tool calls with pydantic objects (especially list return types) cause a deepcopy failure: 'cannot pickle pydantic_core._pydantic_core.ValidatorIterator'.

How others solved it

THEN Upgrade litellm to the latest stable version. The deepcopy issue in litellm's logging setup has been fixed in recent releases. If upgrade is not possible, apply a shallow copy patch in your local litellm installation (not recommended for production).

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics