fix: guard set_skills against serialized crew dict during agent copy

This commit is contained in:
Greyson LaLonde
2026-03-10 18:14:22 -04:00
parent 8b024fffd8
commit 7f7fe840d9

View File

@@ -302,9 +302,11 @@ class Agent(BaseAgent):
Crew-level skill paths are merged in. Skips work when all items are
already resolved and there are no crew-level paths to merge.
"""
from crewai.crew import Crew
crew_skills: list[Path | SkillModel] | None = (
self.crew.skills
if self.crew and isinstance(self.crew.skills, list)
if isinstance(self.crew, Crew) and isinstance(self.crew.skills, list)
else None
)