fix(browser): reject unknown flags on start command (strict parseArgs) - #91
Merged
Conversation
agbrowse start --profile default used to silently ignore --profile because parseArgs was configured with strict: false. Users thought they were connecting to their real Chrome profile when agbrowse always uses its managed profile at $BROWSER_AGENT_HOME/browser-profile. Changes: - start command now uses strict: true + allowPositionals: false - Unknown flags like --profile produce a clear error explaining the profile model - Typos like --headde are caught instead of silently ignored - Three regression tests added to cli-lifecycle.test.mjs Closes: ChatGPT analysis 6a7f0d58 (profile silent-ignore bug)
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.
Problem
agbrowse start --headed --profile defaultsilently ignores--profilebecause parseArgs usesstrict: false. Users think they are connecting to their real Chrome profile, but agbrowse always uses its managed profile at$BROWSER_AGENT_HOME/browser-profile.Root cause
The
startcommand parseArgs call hadstrict: false, so any unknown flag (including--profile, typos like--headde) passed through silently without error.Fix
startparseArgs tostrict: true+allowPositionals: falseTests
rejects --profile flag with a clear error- verifies exit code and error messagerejects unknown flags like --headde (typo protection)- verifies typo rejectionrejects positional arguments on start- verifies positional rejection