Restore validation exit for input-too-large errors#189
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ce9817183
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (exitCode == ExitCodes.UsageError && HasInputTooLargeCode (stdout)) | ||
| { | ||
| return ExitCodes.ValidationError; |
There was a problem hiding this comment.
Keep oversized unknown aliases as usage errors
When an invocation uses an unknown alias with an oversized --initial and --json, TryHandleOversizedInitial deliberately falls through because registry.TryResolve fails, but the package parser still emits an input-too-large JSON error before command resolution. This broad remap then turns that usage failure into exit 65, contradicting the spec/commit note that unknown aliases must remain usage errors (exit 2), e.g. clet nope --json --initial <65K> now exits as validation instead of unknown-command usage.
Useful? React with 👍 / 👎.
input-too-largeerrors for oversized stdin and known-command--initialvalues were falling back to usage exit2. The spec requires these validation failures to exit65so scripts can distinguish bad CLI usage from oversized input.Exit-code mapping
input-too-large→ExitCodes.ValidationError.Oversized
--initialhandling--initialfor registered aliases before the package parser converts it to usage failure.2.Oversized stdin handling
code: input-too-largefrommd --jsonback to validation exit65.Regression coverage
md --jsonstdin.