[Bug]: Fractional numbers are silently truncated for int/long parameters in the testing agent
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
The truncation happens in ConvertInputToAppFunctionDataUseCase, which calls Number.toInt() and toLong() in both the scalar and array branches. Start by reading those two branches and find where the Number value is converted. The change is to accept a Number only when it is a whole number within the target range, and otherwise throw an error that names the parameter. Done when 2.7 is rejected with a clear message, 3.0 is still accepted, and tests cover both the scalar and array cases.
Written by the indexing model from the issue text.
Description
Steps to Reproduce
- Have the model send
2.7for anInt/Longparameter or an element of anIntArray/LongArray.
Expected
Conversion fails with an error naming the parameter, since the value isn't an integer. Whole-number
doubles such as 3.0 can still be accepted.
Observed
The value is silently truncated to 2, and the app function runs with a different value than
the model intended.
Root cause
ConvertInputToAppFunctionDataUseCase converts with Number.toInt() / toLong() for both scalar
and array branches.
Suggested fix
Accept a Number only if it is a whole number (e.g. toDouble() % 1.0 == 0.0, within range).
Otherwise fail with a clear message.
Found during review of the #62 fix.
- Dominant language
- Kotlin
- Stars
- 222
- Forks
- 54
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 26
Getting set up
- No Dockerfile or Docker Compose file
- Has a 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 android/appfunctions
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
android/appfunctions#82 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
android/appfunctions#81 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
android/appfunctions#66 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
android/appfunctions#62 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
android/appfunctions#105 ·
Maintainers usually reply within 1 day
All issues in android/appfunctions
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MetrolistGroup/Metrolist#5426 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
micronizationlab/glafira-ai-hub#785 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sorsama/deepseek-harness-mobile#154 ·
Maintainers usually reply within 1 day
-
0. Needs triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day