fix: ensure positional prompts are passed after --settings flag#677
Open
ex3ndr-bot wants to merge 1 commit intoslopus:mainfrom
Open
fix: ensure positional prompts are passed after --settings flag#677ex3ndr-bot wants to merge 1 commit intoslopus:mainfrom
ex3ndr-bot wants to merge 1 commit intoslopus:mainfrom
Conversation
When passing a positional prompt to happy (e.g., happy "/review ..."), the prompt was being added to the args array before the --settings flag. This could cause Claude CLI to misinterpret the positional prompt since it appeared in the middle of flag arguments rather than at the end. The fix separates flag arguments from positional arguments in claudeArgs and ensures positional arguments (like prompts) are added at the very end of the args array, after all flags including --settings. Closes slopus#663
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
When passing a positional prompt to happy (e.g.,
happy "/review https://..."), the prompt was being added to the args array before the--settingsflag. This could cause Claude CLI to misinterpret the positional prompt since it appeared in the middle of flag arguments rather than at the end.Problem
The issue was that
claudeArgs(which may include positional prompts) were spread into the args array at line 224, but then--settingswas added AFTER at line 228. This resulted in args like:When Claude CLI expects positional prompts to be at the end of the args array.
Solution
Separate flag arguments from positional arguments in
claudeArgs:-) first--settings(required for session hooks)Changes
packages/happy-cli/src/claude/claudeLocal.tsto separate flags from positional argspackages/happy-cli/src/claude/claudeLocal.test.tsto verify correct orderingCloses #663