Skip to content

fix(cli): an unknown flag's error leaves out hidden rename shims - #7746

Merged
miguel-heygen merged 2 commits into
mainfrom
fix/cli-unknown-flag-skips-renamed
Nov 14, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
fix/cli-unknown-flag-skips-renamed

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

What

An unknown flag's error now leaves hidden flags (the ones --help leaves out) out of both its flag list and its "Did you mean". On init that is --template, --video-legacy and --agent.

Why

#7740 made an unknown flag list the command's flags. On init the list included three rename shims that exist only to print "use the new flag" and are hidden from --help, so an agent reading the list could pick one and fail a second time.

Related work

Follow-up to #7740.

How

  • visibleLongFlags in packages/cli/src/utils/reject-unknown-flags.ts skips args declared hidden: true, the marker citty already uses to keep them out of --help. It is now the only input for the list, the synonym target and the closest-match search, so a typo like --templat is no longer pointed at the hidden --template. The shims are still accepted and still print their message.
  • The only hidden args today are those three in init (git grep "hidden: true" packages/cli/src/commands).

Test plan

  • New tests leaves hidden flags out of the list, as --help does and never suggests a hidden flag for a typo (--templat).
  • fails without the fix: each goes red with its change reverted (1 failed of 36, then 1 failed of 37 against the previous head); with both, 37 passed, 3 runs in a row.
  • Real CLI: init --demo x --json no longer lists --template, --video-legacy or --agent; init --templat x --json said "Did you mean --template?" before and no longer suggests a hidden flag.
  • oxfmt --check, oxlint on both files, tsc --noEmit for packages/cli: clean.
  • Documentation updated: not needed.
  • Comments follow CONTRIBUTING.md "Comments".

The list pointed agents at init's --template, --video-legacy and --agent,
which only print an error. It now shows the flags --help shows.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head b947c53d

The 'fails without the fix:' line is present. Hidden flags are still accepted, because knownFlags is unchanged. The blocker: the same hint still suggests the hidden shims through "Did you mean". ↓ inline

Scope

Read in full: reject-unknown-flags.ts at this head. I ran assertKnownFlags against the real init command for --templat, --agnet, --video-legac and --demo. CI was still running when I posted this.

— Genesis

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 94 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqrepeat-none-center-r0-root-z100: tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.05, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

The did-you-mean search still used every spelling, so '--templat' on init
was pointed at the hidden --template. It now uses the same visible flags
the list shows.
@miguel-heygen miguel-heygen changed the title fix(cli): an unknown flag's list leaves out hidden rename shims fix(cli): an unknown flag's error leaves out hidden rename shims Nov 14, 2026

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE — 1 resolved, 0 open, 0 new · b947c53d → fc441334. CI is green on this head. reject-unknown-flags.test.ts passes (37/37).

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit cb52dcf Nov 14, 2026
88 of 89 checks passed
@miguel-heygen
miguel-heygen deleted the fix/cli-unknown-flag-skips-renamed branch November 14, 2026 16:23
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