Skip to content

fix(commands): use ?? instead of || for numeric flag defaults#42

Merged
RyanLee-Dev merged 1 commit intomainfrom
fix/nullish-coalescing-zero-values
Apr 6, 2026
Merged

fix(commands): use ?? instead of || for numeric flag defaults#42
RyanLee-Dev merged 1 commit intomainfrom
fix/nullish-coalescing-zero-values

Conversation

@EElaineYIN
Copy link
Copy Markdown

Summary

  • Replace || with ?? for all numeric flag defaults across 5 command files
  • || treats 0 as falsy → --max-tokens 0 became 4096, --speed 0 vanished
  • 11 sites fixed in: chat, speech, music, video, image commands

Test plan

  • --max-tokens 0 --dry-run → request shows max_tokens: 0
  • --speed 0 --dry-run → request shows speed: 0
  • --n 0 --dry-run → request shows n: 0

🤖 Generated with Claude Code

|| treats 0 as falsy, silently replacing explicit zero values with defaults.
--max-tokens 0 became 4096, --speed 0 vanished entirely. Affects 5 commands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@RyanLee-Dev RyanLee-Dev merged commit 035baa0 into main Apr 6, 2026
2 checks passed
@RyanLee-Dev RyanLee-Dev deleted the fix/nullish-coalescing-zero-values branch April 8, 2026 21:44
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.

2 participants