Skip to content

fix(browser): reject unknown flags on start command (strict parseArgs) - #91

Merged
lidge-jun merged 1 commit into
devfrom
codex/fix-start-strict-parseargs
Aug 14, 2026
Merged

fix(browser): reject unknown flags on start command (strict parseArgs)#91
lidge-jun merged 1 commit into
devfrom
codex/fix-start-strict-parseargs

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Problem

agbrowse start --headed --profile default silently ignores --profile because parseArgs uses strict: 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 start command parseArgs call had strict: false, so any unknown flag (including --profile, typos like --headde) passed through silently without error.

Fix

  • Changed start parseArgs to strict: true + allowPositionals: false
  • Added try/catch with profile-specific error message explaining the dedicated profile model
  • Generic unknown-flag errors also surface clearly

Tests

  • rejects --profile flag with a clear error - verifies exit code and error message
  • rejects unknown flags like --headde (typo protection) - verifies typo rejection
  • rejects positional arguments on start - verifies positional rejection
  • Full suite: 192 files passed, 2224 tests passed, 0 failures

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)
@lidge-jun
lidge-jun merged commit c9c19ac into dev Aug 14, 2026
1 check passed
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