Skip to content

Fix KeyError when loading first skill in skills_tool#1122

Merged
frdel merged 1 commit intotestingfrom
codex/fix-keyerror-in-skills_tool-loading
Feb 24, 2026
Merged

Fix KeyError when loading first skill in skills_tool#1122
frdel merged 1 commit intotestingfrom
codex/fix-keyerror-in-skills_tool-loading

Conversation

@frdel
Copy link
Collaborator

@frdel frdel commented Feb 24, 2026

Motivation

  • Prevent a KeyError: 'loaded_skills' when calling skills_tool load for the first time in a fresh session by handling a missing key safely.

Description

  • Use self.agent.data.get(DATA_NAME_LOADED_SKILLS) instead of direct indexing and initialize the list when the key is absent so the skill can be recorded without error.

Testing

  • Ran python -m py_compile python/tools/skills_tool.py successfully; attempted pytest tests/test_skills_tool.py but collection failed due to missing optional runtime dependencies in the test environment, so the pytest run did not complete.

Codex Task

@frdel frdel merged commit 55d1aca into testing Feb 24, 2026
longman391 added a commit to longman391/agent-zero that referenced this pull request Feb 24, 2026
@frdel frdel deleted the codex/fix-keyerror-in-skills_tool-loading branch March 26, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant