Repository navigation
Conversation
… earlier ones parseClaudeArgsToExtraArgs decides boolean-vs-value before it looks at whether the flag accumulates, so an occurrence with no usable value falls into the else branch and writes null over what the earlier ones collected. shell-quote returns "" for --allowedTools "", and "" is falsy, so the empty string counts as no value. Tag and agent mode both prepend their own --mcp-config and --allowedTools in front of the user's claude_args, so a user writing --allowedTools "" drops the action's own list, including mcp__github_comment__update_claude_comment, and a bare --mcp-config drops the github_comment server config. --allowedTools A --allowedTools "" -> allowedTools undefined --add-dir /work --add-dir "" -> additionalDirectories undefined Decide the accumulating case first, skip empty tokens while gathering, and leave the flag as it was when an occurrence contributes nothing. Four tests, all failing before the change.
This branch has not been deployed
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.
What is wrong
parseClaudeArgsToExtraArgs(base-action/src/parse-sdk-options.ts) decides whether a flag is a boolean before it looks at whether the flag accumulates:nextArg &&is a truthiness test, soshell-quote's""for--allowedTools ""counts as "no value" and the occurrence falls into the else branch, which writesnullover everything the earlier occurrences accumulated. Same for a--flagwith nothing after it.That matters because tag and agent mode put their own flags in front of the user's
claude_args(src/modes/tag/index.ts:180-192, agent mode the same). Running the tag-mode prefix throughparseSdkOptions:So a user who writes
claude_args: --allowedTools ""loses the action's own tool list,mcp__github_comment__update_claude_commentincluded, and Claude can no longer update its own comment. A bare--mcp-configdrops thegithub_commentserver config and leavesnullinextraArgs, which then reaches the CLI as a flag with no value.What this changes
Decide the accumulating case first, since those flags are never booleans. Gather every consecutive non-flag token and skip the empty ones; an occurrence that contributes nothing leaves the flag exactly as it was. The non-accumulating path is unchanged.
A side effect worth noting: a bare
--mcp-configwith no earlier value now leaves the key absent rather thannull. Absent is what the SDK wants;nullbecame a valueless flag on the command line.I did not add a warning when an occurrence is dropped. Say the word if you would like one, it is two lines.
Test Plan
Four new tests in
base-action/test/parse-sdk-options.test.ts, all failing before the change:--allowedToolsafter a real one keeps the real one--allowedToolsbefore another flag keeps the real one--mcp-configkeeps the earlier config--add-dirkeeps the earlier directoryThe nine are all in
test/github-graphql-url.test.ts("GitHub API client endpoint routing"). They fail the same way on unmodifiedmainin a worktree here, because they reach github.com and this machine has no network for them, so they are environmental rather than anything in this change.prettier --checkclean on both files.