mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-15 23:42:37 +00:00
BaseTool could not serialize to JSON because args_schema (a class reference) and cache_function (a lambda) are not JSON-serializable. This caused checkpointing to crash for any crew with tools. - Add PlainSerializer to args_schema so it round-trips via JSON schema - Replace default cache_function lambda with named _default_cache_function and type it as SerializableCallable - Add computed_field tool_type storing the fully qualified class name - Add __init_subclass__ registry and __get_pydantic_core_schema__ on BaseTool so any list[BaseTool] field automatically dispatches to the concrete subclass during deserialization via tool_type lookup - No changes needed to BaseAgent.validate_tools or Task — Pydantic handles it natively through the custom core schema