🤖 fix: agent tool inheritance from base agents #1392
Merged
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
Fixed a bug where agents using
baseinheritance (likeaskwhich extendsexec) had no tools available despite claiming tools in the UI.Root Cause
resolveToolPolicyForAgentonly looked at the current agent'sfrontmatter.tools.addpatterns, ignoring thebaseinheritance chain.For example, the
askagent has:It has no
addpatterns - it relies on inheritingadd: [.*]fromexec. The old code only saw an empty add list, so it created a policy that denied all tools.Fix
Modified
resolveToolPolicyForAgentto:collectToolConfigs()(base first, then child)Now for
ask (base: exec):exec: enable.*, disablepropose_plan, disableask_user_questionask: disablefile_edit_.*Result: All tools enabled except
propose_plan,ask_user_question, andfile_edit_.*- exactly as intended.Testing
Generated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high