Bug: numeric settings editor saves overflow values as null
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- cli
Research direction
Start with parseEditedValue in packages/cli/src/utils/settingsUtils.ts and the focused cases in src/utils/settingsUtils.test.ts under packages/cli. Check how SettingsDialog.tsx handleEditCommit uses the parsed result and review commentJson.ts for the serialization path; done means non-finite numeric input is rejected and the existing setting is not replaced by null.
Written by the indexing model from the issue text.
Description
What happened?
The numeric settings editor accepts non-finite numeric values.
For example:
parseEditedValue('number', '1e309')
returns Infinity because the parser only rejects Number.isNaN() results.
The Settings dialog treats this as a valid value and passes it to setSetting. When the settings serializer writes the value to JSON, it becomes:
{
"model": {
"compressionThreshold": null
}
}
This means an input accepted by the Settings dialog is silently changed into an invalid numeric configuration value.
I added this focused regression test locally:
expect(parseEditedValue('number', '1e309')).toBeNull();
I ran:
npx --yes --package=node@20.19.0 node ./node_modules/vitest/vitest.mjs run src/utils/settingsUtils.test.ts --root packages/cli
Result:
Test Files 1 failed (1)
Tests 1 failed | 49 passed (50)
Expected: null
Received: Infinity
What did you expect to happen?
The numeric settings parser should reject non-finite values such as Infinity, -Infinity, and overflow values such as 1e309.
The Settings dialog should leave the existing setting unchanged instead of saving null.
Client information
Client Information
Tested from the latest source checkout.
CLI Version 0.60.0-nightly.20260901.g0bd1d4397
Git Commit 85aca163f6c73ac6ce380b5447359146b8adcae4
Node.js 20.19.0
OS macOS 26.5.2 arm64
Sandbox no sandbox
Auth Method not applicable
Login information
Not authentication-related. The behavior is in the local settings parser and serializer.
Anything else we need to know?
Relevant code:
- packages/cli/src/utils/settingsUtils.ts: parseEditedValue
- packages/cli/src/ui/components/SettingsDialog.tsx: handleEditCommit
- packages/cli/src/utils/commentJson.ts: settings serialization
I searched existing open and closed issues and pull requests using Infinity, non-finite, 1e309, numeric input, and settings validation terms. I did not find a matching report or implementation.
I am willing to implement a small fix with regression tests if maintainers consider this suitable for a community contribution.
- Dominant language
- TypeScript
- Stars
- 107k
- Forks
- 14.6k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 43
Contributor 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 google-gemini/gemini-cli
-
bug(core): explicit `--model gemini-3-pro-preview` silently rewritten to `gemini-3.1-pro-preview` Openarea/agent effort/medium kind/bug priority/p2 status/bot-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
google-gemini/gemini-cli#29417 · 1 comment ·
-
area/enterprise kind/bug priority/p2 status/bot-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
google-gemini/gemini-cli#29406 ·
-
area/agent status/need-triage
Difficulty 2/5 Half a day Newbie friendliness 78/100
google-gemini/gemini-cli#29360 ·
-
area/agent kind/bug priority/p2 status/bot-triaged
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
google-gemini/gemini-cli#29315 ·
-
area/non-interactive effort/small kind/bug priority/p2 status/bot-triaged status/need-information
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
google-gemini/gemini-cli#29308 · 2 comments ·
All issues in google-gemini/gemini-cli
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100