Skip to content

fix(tools): hide skill script tool when no scripts exist#6300

Open
Oxygen56 wants to merge 1 commit into
google:mainfrom
Oxygen56:fix-skill-toolset-script-tool-exposure
Open

fix(tools): hide skill script tool when no scripts exist#6300
Oxygen56 wants to merge 1 commit into
google:mainfrom
Oxygen56:fix-skill-toolset-script-tool-exposure

Conversation

@Oxygen56

@Oxygen56 Oxygen56 commented Jul 5, 2026

Copy link
Copy Markdown

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Problem:
SkillToolset always exposed run_skill_script, even when the configured local skills had no scripts. That gives the model an unavailable action surface and can contribute to repeated failed script calls.

Solution:
Only register RunSkillScriptTool when at least one local skill exposes scripts. Registry-backed toolsets keep the previous behavior because remote skill contents are not known at initialization time.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Passed locally:

uv run --extra test pytest tests/unittests/tools/test_skill_toolset.py
# 115 passed, 4 warnings
uv run --extra dev ruff check src/google/adk/tools/skill_toolset.py tests/unittests/tools/test_skill_toolset.py
# All checks passed

Manual End-to-End (E2E) Tests:

Not run. The change is covered by isolated unit tests for the tool list returned by SkillToolset.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

This keeps the script execution tool out of the model-visible tool list when there is no local script to run, while preserving registry behavior for dynamically loaded remote skills.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SkillToolset exposes run_skill_script tool causing hallucination loop when skill has no scripts/ directory

1 participant