CLI: an empty numeric flag value is read as 0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 83/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- cli
Research direction
Start with parseFlagValue in src/cli/parser/args.ts, where the issue identifies Number(value) and the finite-number check as the cause. Compare its handling of empty input with the existing missing-value and booleanOrString behavior. Done means blank numeric flag values are rejected with the expected requires-a-value message, while valid numeric values still parse correctly.
Written by the indexing model from the issue text.
Description
What happens
An int or number flag given an empty or blank value is accepted as 0. For flags with a minimum of 0, the command runs with no error:
agent-device test ./suite --retries= # runs with retries 0
agent-device test ./suite --retries "" # same
RETRIES= ; agent-device test ./suite --retries="$RETRIES"
The same applies to --hold-ms, --delay-ms, --pause-ms, --interval-ms, --duration-ms, --jitter-px, and --settle-quiet. For flags with a minimum of 1 or more, such as --count=, the error is Invalid count: with an empty value, which does not name the cause.
Expected
The parser refuses the flag with Flag --retries requires a value., as it already does for a missing value and for an empty booleanOrString inline value.
Cause
parseFlagValue in src/cli/parser/args.ts converts the value with Number(value) and checks only Number.isFinite. Number('') and Number(' ') are 0.
Environment
main at 6e8c2a0, Node 22.22.0, Linux.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 334
- Avg merge
- 12h 13m
- Merged PRs (30d)
- 723
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
callstack/agent-device#3819 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
callstack/agent-device#3851 ·
Maintainers usually reply within 1 day
-
feat(hardware-button): press phone volume and power buttons on Android and iOSPossibly taken @thymikee claimed this today. Openneeds-triage
Difficulty 5/5 Over a week Newbie friendliness 25/100
callstack/agent-device#3848 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
callstack/agent-device#3844 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
logancyang/obsidian-copilot#3753 ·
Maintainers usually reply within 1 day
-
area: presentation severity: important
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
voithos-labs/aragonite#763 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
diegosouzapw/OmniRoute#17386 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 72/100
super-productivity/super-productivity#10982 · 1 comment ·
Maintainers usually reply within 1 day