fix(skills): Make SkillToolset system instruction respect tool_filter#6449
Open
nicobytes wants to merge 3 commits into
Open
fix(skills): Make SkillToolset system instruction respect tool_filter#6449nicobytes wants to merge 3 commits into
nicobytes wants to merge 3 commits into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Author
|
recheck |
nicobytes
force-pushed
the
fix/skill-toolset-instruction-tool-filter
branch
from
July 22, 2026 15:35
9795561 to
8daac80
Compare
process_llm_request always advertised run_skill_script and load_skill_resource even when tool_filter excluded them, causing the model to call undeclared tools and crash with ValueError. Build the injected system instruction from selected tools only, and explicitly forbid filtered-out script/resource tools. Fixes google#6448
nicobytes
force-pushed
the
fix/skill-toolset-instruction-tool-filter
branch
from
July 22, 2026 15:36
8daac80 to
8977e84
Compare
Collaborator
|
Hi @nicobytes , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share. |
Collaborator
|
Hi @sasha-gitg , can you please review this. LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tool_filter(list or predicate)run_skill_script/load_skill_resourcewhen filtered out, and explicitly tell the model not to call them — reply as normal text insteadprocess_llm_requestconsistent with the filter: inject skills XML whenlist_skillsis filtered out, and omit thesearch_skillsregistry hint when that tool is filtered outWhy
get_tools()already respectedtool_filter, butprocess_llm_requestalways injected_build_skill_system_instruction(), which unconditionally told the model to userun_skill_scriptandload_skill_resource. With instruction-only skills (tool_filter=["list_skills", "load_skill"]), Gemini often wrapped the final reply in a hallucinatedrun_skill_scriptcall →UNEXPECTED_TOOL_CALL/ValueError: Tool 'run_skill_script' not found.and an empty user-facing response.Fixes #6448
Related to #6281
Testing Plan
DEFAULT_SKILL_SYSTEM_INSTRUCTIONcontract unchangedprocess_llm_requestwithtool_filter=["list_skills", "load_skill"]injects filtered instructionlist_skillsinjects skills XML fallbacksearch_skillscontrols the registry hinttool_name_prefix+ filter uses prefixed names in instruction/banToolPredicatefilter is respected by the injected instructiontest_skill_toolset.pysuite greenManual repro (pre-fix)
Before: model often calls
run_skill_scriptafterload_skill→ crash.After: instruction no longer advertises filtered tools and tells the model to answer as normal text.