From dc047743b87ee308f41540aafc7833d374547f1d Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Thu, 21 May 2026 02:26:57 +0800 Subject: [PATCH] fix: surface clear error when dotted-path provider needs ctor args --- lib/crewai/src/crewai/types/callback.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/crewai/src/crewai/types/callback.py b/lib/crewai/src/crewai/types/callback.py index 119d7d517..a0703c9b3 100644 --- a/lib/crewai/src/crewai/types/callback.py +++ b/lib/crewai/src/crewai/types/callback.py @@ -204,4 +204,11 @@ def _dotted_path_to_instance(value: Any) -> Any: f"Invalid provider path {value!r}: expected a class, got " f"{type(cls).__name__}" ) - return cls() + try: + return cls() + except TypeError as exc: + raise ValueError( + f"Cannot reinstantiate {value!r} with no arguments: {exc}. " + "Only no-arg constructors are checkpointable; rebuild the " + "instance manually and assign it after restore." + ) from exc