[Bug]: Testing agent gives one service's tools inconsistent name prefixes, so the model calls names that don't exist
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend-api-design
Research direction
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.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Kotlin
- Stars
- 210
- Forks
- 45
- Avg merge
- 12h 24m
- Merged PRs (30d)
- 3
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
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 90/100
android/appfunctions#66 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
android/appfunctions#62 ·
-
[FR]: Testing agent should handle AppFunctionUriGrant results and pass returned images to the modelOpen
Difficulty 4/5 3-5 days Newbie friendliness 45/100
android/appfunctions#63 ·
-
Clarify production invocation, Android Auto support, and Android 16 fallback in AppFunctions docsOpen
Difficulty 4/5 3-5 days Newbie friendliness 52/100
android/appfunctions#51 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
android/appfunctions#50 · 1 comment ·
All issues in android/appfunctions
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
ReadYouApp/ReadYou#1347 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
yschimke/compose-preview-contracts#210 ·
Maintainers usually reply within 1 day
-
afk-ok area:data-quality importer size:S
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
enorm-labs/event-junkie#4221 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
yschimke/compose-ui-builder#1054 ·
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
leonlatsch/Photok#816 ·
Maintainers usually reply within 1 day