Files
crewAI/lib
Greyson LaLonde 7c3b987037 fix: make BaseTool survive checkpoint JSON round-trip
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 so it serializes to a dotted path
- Add computed_field tool_type that stores the fully qualified class name
- Add restore_tool_from_dict to reconstruct the concrete subclass from
  checkpoint dicts, pre-resolving callback strings to callables
- Update BaseAgent.validate_tools and Task._restore_tools_from_checkpoint
  to handle dict inputs from checkpoint deserialization
2026-04-07 02:14:03 +08:00
..