Skip to content

fix: validate CLI --mode with a click Choice - #16

Merged
royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:fix/cli-mode-choice
Sep 16, 2026
Merged

royalpinto007 merged 1 commit into
AgentPostmortem:mainfrom
sharadvc:fix/cli-mode-choice

Conversation

@sharadvc

Copy link
Copy Markdown
Contributor

What

CLI --mode was a free string, so --mode hybird died deep inside search.py with an unknown mode traceback instead of a usage error listing valid modes.

Change

Constrain --mode to a click.Choice(["dense", "sparse", "hybrid"]), so a typo fails fast with 'hybird' is not one of 'dense', 'sparse', 'hybrid'. (click is already vendored as a typer dependency; the runtime environment is unchanged).

Tests

Added tests/test_cli.py first: parametrized over hybird, HYBRID, and dense , each must exit non-zero with an error that lists hybrid. Suite: 24 passed. ruff check clean.

Related

Closes #14

A free-string --mode died deep inside with an unknown-mode traceback.
Constrain the option to dense/sparse/hybrid so typos fail fast with a
usage error listing the valid modes.

Closes AgentPostmortem#14
@royalpinto007
royalpinto007 merged commit fe7746d into AgentPostmortem:main Sep 16, 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.

CLI --mode is a free string, typos die with a traceback

2 participants