[Bug]: Integers outside the Long range from the LLM become Double and lose precision
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The conversion lives in JsonElement.toPrimitive() in the agent module's domain/JsonExtensions.kt, which tries toLongOrNull() then toDoubleOrNull(). Start there and reproduce with a number above Long.MAX_VALUE sent for a String parameter. Done when the literal digits reach the app function unchanged and existing number conversions still pass their tests.
索引モデルが issue の本文から書いたものです。
説明
Steps to Reproduce
- Have the model send an integer above
Long.MAX_VALUE(e.g. an ID such as12345678901234567890)
for aStringor string-array parameter.
Expected
The value reaches the app function exactly as the digits the model sent ("12345678901234567890").
Observed
"1.2345678901234567E19".
Root cause
JsonElement.toPrimitive() (agent/.../domain/JsonExtensions.kt) tries toLongOrNull() and then
toDoubleOrNull(), so big integers become Double. The raw JSON content is then lost before
type-aware conversion.
Suggested fix
Keep the raw JSON content for numbers that don't fit Long, for example as a String or BigDecimal. Or
convert with the parameter's metadata, so string parameters receive the literal digits.
Found during review of the #62 fix.
- 主要言語
- Kotlin
- スター
- 222
- フォーク
- 54
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 26
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
android/appfunctions のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
android/appfunctions#84 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
android/appfunctions#82 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
android/appfunctions#81 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
android/appfunctions#66 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
android/appfunctions#62 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
android/appfunctions の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MetrolistGroup/Metrolist#5426 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
micronizationlab/glafira-ai-hub#785 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sorsama/deepseek-harness-mobile#154 ·
メンテナーはふだん 1 日以内に返信
-
0. Needs triage enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信