Skip to content

fix: reject invalid numeric flags#120

Open
NianJiuZst wants to merge 1 commit intoMiniMax-AI:mainfrom
NianJiuZst:codex/validate-numeric-flags
Open

fix: reject invalid numeric flags#120
NianJiuZst wants to merge 1 commit intoMiniMax-AI:mainfrom
NianJiuZst:codex/validate-numeric-flags

Conversation

@NianJiuZst
Copy link
Copy Markdown
Contributor

Summary

  • validate number-typed flags during parseFlags
  • reject empty, NaN, and infinite numeric inputs before commands build requests
  • add parser coverage for invalid and valid number values

Root cause

Number flags were parsed with Number(value) and stored without validation. Invalid input such as --max-tokens abc became NaN, which could later serialize as null in request JSON or fail deeper in timeout handling.

Validation

  • bun test test/args.test.ts
  • bun run typecheck
  • bunx eslint src/args.ts test/args.test.ts
  • bun test

Note: full repository lint still has pre-existing failures in unrelated tests: test/auth/timeout-fix.test.ts and test/client/stream.test.ts.

@NianJiuZst NianJiuZst marked this pull request as ready for review April 29, 2026 18:04
@NianJiuZst NianJiuZst changed the title [codex] reject invalid numeric flags fix: reject invalid numeric flags Apr 29, 2026
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