You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cli: check silently replaces invalid --samples/--max-issues/--tolerance with defaults instead of exiting 2 #7672
bugSomething isn't workingdifficulty/mediumBounded work requiring subsystem knowledge, related paths, or additional regression fixtures.help wantedReady, available work with maintainer review support; any difficulty.
hyperframes check rejects a bad --range with exit code 2 (a usage error). Several of its numeric flags don't, though. An invalid value is silently replaced with the default, so the run looks fine but used different settings than the user asked for:
Flag
Example
What happens today
--samples
--samples 0, --samples ten
uses 9
--max-issues
--max-issues -5
uses 80
--max-transition-samples
--max-transition-samples abc
no cap
--tolerance
--tolerance -1, --tolerance px
uses 2
The cause is positiveInteger and nonNegativeNumber in packages/cli/src/commands/check.ts (around line 721). Both return the fallback for anything they can't parse. parseInt also accepts junk after a number, so --samples 5abc is read as 5.
What to do
Throw CliUsageError (as parseCheckRange already does) when one of these flags is given a value that isn't a valid number in range. The error message should name the flag and the value.
Leave the defaults alone when a flag isn't passed.
Add tests showing that each bad value exits 2 with a usage_error under --json, and that valid values still work.
This one is medium difficulty: it touches several flags and needs a small, careful set of tests.
I'd like to take this one. Plan: positiveInteger / nonNegativeNumber in check.ts take the flag name, return the default only when the flag is absent, and otherwise parse with Number() (so 5abc and 2px are rejected too) and throw CliUsageError with Invalid --<flag>: "<value>"; use a positive integer (or non-negative number). Tests in check.test.ts for each bad value from the table plus valid values/defaults, and two rows in the agent-mode flag-check table. PR coming shortly.
bugSomething isn't workingdifficulty/mediumBounded work requiring subsystem knowledge, related paths, or additional regression fixtures.help wantedReady, available work with maintainer review support; any difficulty.
Activity
bardrop commentedon Nov 13, 2026
I'd like to take this one. Plan:
positiveInteger/nonNegativeNumberincheck.tstake the flag name, return the default only when the flag is absent, and otherwise parse withNumber()(so5abcand2pxare rejected too) and throwCliUsageErrorwithInvalid --<flag>: "<value>"; use a positive integer(or non-negative number). Tests incheck.test.tsfor each bad value from the table plus valid values/defaults, and two rows in the agent-mode flag-check table. PR coming shortly.fix(cli): reject invalid check numeric flags as usage errors (heygen-…