mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-10-21 04:40:13 +00:00
Merge pull request #1205 from vanja-emichi/fix/skills-tool-keyerror-loaded-skills
fix: use .get() to avoid KeyError in skills_tool _load()
This commit is contained in:
commit
b7e150fabd
1 changed files with 1 additions and 1 deletions
|
|
@ -123,7 +123,7 @@ class SkillsTool(Tool):
|
|||
return f"Error: skill not found: {skill_name!r}. Try skills_tool method=list or method=search."
|
||||
|
||||
# Store skill name for fresh loading each turn
|
||||
if not self.agent.data[DATA_NAME_LOADED_SKILLS]:
|
||||
if not self.agent.data.get(DATA_NAME_LOADED_SKILLS):
|
||||
self.agent.data[DATA_NAME_LOADED_SKILLS] = []
|
||||
loaded = self.agent.data[DATA_NAME_LOADED_SKILLS]
|
||||
if skill.name in loaded:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue