Skip to content

fix: deduplicate base tools in buildAllowedTools#154

Open
ben-rogerson wants to merge 2 commits intomainfrom
fix/tool-name-map-double-includes-base-tools
Open

fix: deduplicate base tools in buildAllowedTools#154
ben-rogerson wants to merge 2 commits intomainfrom
fix/tool-name-map-double-includes-base-tools

Conversation

@ben-rogerson
Copy link
Copy Markdown
Owner

Summary

When a read-only or full-permission agent explicitly declared read/glob/grep in its tools array, those tools would appear twice in the resulting allowedTools string (once from the hardcoded baseline, once from the user's list). Wrap the concatenated arrays in a Set to deduplicate before joining. Add regression tests to verify no duplicates appear for both permission levels.

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm test

When a read-only or full-permission agent explicitly declared read/glob/grep in its tools array, those tools would appear twice in the resulting allowedTools string (once from the hardcoded baseline, once from the user's list). Wrap the concatenated arrays in a Set to deduplicate before joining. Add regression tests to verify no duplicates appear for both permission levels.
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.

1 participant