Skip to content

docs(guides): add the required _register_tools stub to composing-skills - #6931

Merged
kovtcharov-amd merged 2 commits into
amd:mainfrom
burgulvedant:docs/composing-skills-register-tools
Nov 7, 2026
Merged

kovtcharov-amd merged 2 commits into
amd:mainfrom
burgulvedant:docs/composing-skills-register-tools

Conversation

@burgulvedant

@burgulvedant burgulvedant commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The agent class in section 3 of the composing-skills guide leaves out _register_tools, which is abstract on the base Agent. Copying it and running section 5 raises TypeError: Can't instantiate abstract class. The example now defines it and registers read_file and search_code through FileIOToolsMixin, the two tools the guide's api-compatibility skill needs, so the skill can run its own steps.

Closes #3415

Test plan

  • A subclass with the stub and FileIOToolsMixin has no abstract methods left, and read_file and search_code are registered

…skills agent

The agent class in section 3 of the composing-skills guide leaves out
_register_tools, which is abstract on the base Agent, so section 5's
MyReviewAgent(skill_set="library") raises TypeError. Add an empty
stub and say why it can be empty.

Closes amd#3415
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Verdict: Request changes

Adding the missing method fixes the real crash: anyone copying the guide's agent got a TypeError before it ever started. But the explanation that comes with it is wrong. Skills don't bring tools. They only name tools the agent must already have, and the guide says so itself a few sections earlier. A reader who follows the new text ends up with an agent whose example skill can't run its own steps.

  • Fix the wording, or better, make the example register the tools its skill needs. The guide's api-compatibility skill uses read_file and search_code. With the method left empty, neither tool exists, so the skill loads, logs a warning, and can't do its job. One existing mixin provides both tools, so the fix is small.

Real-world evidence

N/A: docs-only change. This verdict rests on static review, checked against the base Agent class and the skill loader.

🔍 Technical details

Issues found

🟡 "The skills bring the tools" contradicts the guide and the loader (docs/guides/composing-skills.mdx:146-155)

  • §1 of the same guide (lines 77–82) says tools_required "does not grant anything" and that an unregistered name gets logged at load time.
  • The loader agrees: src/gaia/agents/base/agent.py:4830-4842 logs "Skill '%s' expects tool(s) %s, which this agent does not have registered" for every name missing from _tools_registry. Dynamic tool loading only activates tools that are already registered. It never creates them.
  • With an empty _register_tools, §5's MyReviewAgent(skill_set="library") does instantiate, but api-compatibility logs that read_file and search_code are missing. The guide's own example skill can't execute.
  • FileIOToolsMixin (src/gaia/agents/tools/file_io_tools.py, register_file_io_tools) registers both read_file and search_code, so the example can be made correct in a few lines:
    # Abstract on the base Agent. Skills only *name* the tools they use
    # (tools_required), so register them here.
    def _register_tools(self) -> None:
        self.register_file_io_tools()

With that change, the class line becomes class MyReviewAgent(FileIOToolsMixin, Agent):, with from gaia.agents.tools.file_io_tools import FileIOToolsMixin in the imports. The prose at lines 153–155 changes to match:

skills plus that set's, in declaration order. `_register_tools()` is the one
method every `Agent` subclass must define. Register the tools your skills'
`tools_required` name there; a skill never brings its own tools.

If you'd rather keep the stub empty, at minimum replace "the skills bring the tools" / "the loaded skills supply the tools" with a sentence saying an empty stub only works for instruction-only skills that need no tools. That still leaves the guide's example skill unrunnable, though.

Strengths

The skill in the composing-skills example names read_file and search_code,
but a skill does not provide tools. Have the example agent register them
through FileIOToolsMixin so the skill can run its own steps.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 7, 2026
Merged via the queue into amd:main with commit 11deb43 Nov 7, 2026
21 checks passed
@kovtcharov-amd kovtcharov-amd mentioned this pull request Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The agent class printed in section 3 cannot be instantiated - section 5's first line raises TypeError

2 participants