[Bug]: Testing agent gives one service's tools inconsistent name prefixes, so the model calls names that don't exist
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 1-2 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
调研方向
Start by locating GeminiToolConverter.getGeminiFunctionName and trace how converted function names are matched when the Gemini provider receives a tool call; the report also names GeminiProviderImpl as a possible entry point. Reproduce with one service whose methods cross the 64-character cutoff at different points, then verify that its tools have consistent names or that calls resolve correctly; the issue provides no test file to run.
由索引模型根据 Issue 内容生成。
描述
Description
The Testing Agent shortens each AppFunction id to a Gemini function name of at most 64 characters by keeping as many _-separated parts as fit, from the right (GeminiToolConverter.getGeminiFunctionName). Because the cutoff depends on each method's length, the tools of one service end up with different prefixes:
com.example.app.feature.notes.ExampleNotesAppFunctionService#addNote
-> example_app_feature_notes_ExampleNotesAppFunctionService_addNote
com.example.app.feature.notes.ExampleNotesAppFunctionService#updateNoteSettings
-> feature_notes_ExampleNotesAppFunctionService_updateNoteSettings
com.example.app.feature.notes.ExampleNotesAppFunctionService#getNoteFieldDescriptions
-> notes_ExampleNotesAppFunctionService_getNoteFieldDescriptions
The model generalizes from the majority and "corrects" the others, so it calls names that don't exist, for example:
Called unknown function: feature_notes_ExampleNotesAppFunctionService_getNoteFieldDescriptions
We also saw a doubled prefix (the shortened prefix repeated in front of a full name) from the same confusion. Each failure ends the agent's turn.
Steps to reproduce
- Expose a service with a long package and class name and methods of varying length (anything that crosses the 64-character cutoff at different parts).
- Run a task in Agent Demo that needs one of the longer-named functions.
- The model calls a prefixed variant and the agent reports
Called unknown function.
Suggested fix
Any of these would help:
- Give all tools of one service the same prefix, e.g. pick the cutoff once per service (the deepest part every method of that service fits), or use
ClassName_methodwith a short hash when even that exceeds 64 characters. - Resolve calls tolerantly: when the exact name is unknown, fall back to the unique tool whose name ends with the called name's
ClassName_methodsuffix. A local patch doing this inGeminiProviderImplremoved the errors in our testing.
Environment
- Testing Agent at a3a2a89 (main, Oct 23, 2026)
- androidx.appfunctions 1.0.0-beta01
- Android 17 (API 37) emulator, model gemini-3.5-flash
Related: #62, #63.
- 主要语言
- Kotlin
- 星标
- 210
- 派生
- 45
- 平均合并
- 12 小时 24 分钟
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
android/appfunctions 的其他 Issue
-
documentation
难度 1/5 1 小时以内 新手友好度 90/100
android/appfunctions#66 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
android/appfunctions#62 ·
-
[FR]: Testing agent should handle AppFunctionUriGrant results and pass returned images to the model未关闭
难度 4/5 3-5 天 新手友好度 45/100
android/appfunctions#63 ·
-
Clarify production invocation, Android Auto support, and Android 16 fallback in AppFunctions docs未关闭
难度 4/5 3-5 天 新手友好度 52/100
android/appfunctions#51 ·
-
难度 4/5 3-5 天 新手友好度 48/100
android/appfunctions#50 · 1 条评论 ·
查看 android/appfunctions 的全部 Issue
相似的 Issue
-
pending:code-area pending:issue-category to-triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
T31n/YagniLauncher#1096 ·
维护者通常 1 天内回复
-
win_build: parallel PostBuildEvent race in example_app_atiopencl and example_app_nvopencl copying openclapp_kernels.cl可能已有人在做 @qixuancao 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 73/100
维护者通常 1 天内回复
-
OkHttp versions 5.4.0+ no longer include baseline-prof.txt可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 1/5 1 小时以内 新手友好度 83/100
lysine-dev/okhttp#9828 ·
维护者通常 1 天内回复
-
[Type] Bug Android
难度 2/5 1-3 小时 新手友好度 79/100
wordpress-mobile/GutenbergKit#847 ·
维护者通常 1 天内回复