Skip to content

bug(cli): unrecognized arguments create sessions instead of erroring #3352

Description

@OneStepAt4time

Bug Report — CLI Dogfooding

Command: ag foobar (or any unrecognized argument)
Expected: Error: "Unknown command: foobar. Run ag --help for usage."
Actual: Creates a session with prompt "foobar".

Reproduction

$ ag foobar
  ✅ Session created: cc-foobar
     ID: 3e3fa9b3-ad19-4a71-a692-54b84139b050
  ✅ Brief delivered (attempt 1)

Problem

The CLI treats any unrecognized argument as a session brief via the shorthand ag "brief" syntax. This means typos like ag statis, ag list, ag stop, ag status all create unwanted sessions instead of showing an error.

This contradicts the intent of PR #3035 which added --reject-unknown-commands to the CLI.

Suggested Fix

Only treat arguments as briefs if they look intentional (e.g., quoted strings or sentences). Single-word arguments that match common command-like patterns should be rejected with a helpful error.

Severity

P2 — creates zombie sessions from typos, confusing for new users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugSomething isn't workingreleasedIncluded in a published release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions