fix: parse ALL --allowed-tools flags, not just the first one - #801
Conversation
The parseAllowedTools() function previously used .match() which only returns the first match. This caused tools specified in subsequent --allowed-tools flags to be ignored during MCP server initialization. Changes: - Add /g flag to regex patterns for global matching - Use matchAll() to find all occurrences - Deduplicate tools while preserving order - Make unquoted pattern not match quoted values Fixes anthropics#800 #vibe Co-authored-by: Claude <noreply@anthropic.com>
|
@AlexanderBartash after this v1.0.30 our workflow is now failing. here is the workflow: we are getting below error: |
|
@sachinmahale Comments are not allowed in the |
|
@AlexanderBartash I tried removing complete claude_args: block, still its not working. |
|
@sachinmahale The changes in PR #801 only affect the parsing of |
|
@sachinmahale E.g. |
|
@AlexanderBartash our workflow was working fine till 16th Jan. but after the release v1.0.30 it started failing. |
|
@sachinmahale Between 30 and 28 there is also 29 :) I cannot really help you because I do not see your workflow logs, nor your full workflow. I already provided feedback based on what you gave me. |
|
@sachinmahale Please read my messages properly. I am not sure that you can remove |
Summary
Fixes #800
The
parseAllowedTools()function previously used.match()which only returns the first match. This caused tools specified in subsequent--allowed-toolsflags to be ignored during MCP server initialization.Changes
/gflag to regex patterns for global matchingmatchAll()to find all occurrencesRoot Cause
When users specify multiple
--allowed-toolsflags:Only tools from the first flag were parsed. This broke MCP server initialization when
mcp__github_*tools weren't in the first flag.Test plan
--allowed-toolsflags