spring-projects / spring-projects/spring-ai
Agent Skills function calling fails when LLM targets sub-skill name directly (e.g., "pdf" instead of "Skill")
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Description
Bug description
I've noticed a phenomenon, but I'm unsure if it's a bug or intentional. First, during ChatClient initialization, I pass Skills to defaultToolCallBacks(). Then, I started debugging from the dialog and found that among the Tools passed to LLM, one was named "Skill," while the others were several system-defined Tools (like ShellTools). This approach presents a problem. In my test, I had LLM create a blank PDF (this skill came from the Claude Skills official library, which I fetched locally). However, debugging revealed that the function name in the AssistantMessage returned by LLM was "pdf," which is the specific skill name. This means it wouldn't target the aforementioned Skill Tool. Then, I used the hint: "If you are using a skill from the Skills list, then the returned function name should always be 'Skill' (this tip mainly limits the situations where a Skill is required)." This successfully enabled LLM to create a blank PDF using the Skill.
Environment
Spring AI 2.0.0-M2,Spring Agent Skills 0.4.2
Steps to reproduce
1、init Chat client:
2、skill:
3、start ->
4、Without adding prompt words:
4.1、return:
5、Cases where additional prompt words are added:
5.1、return:
Expected behavior
I think we should either make it compatible with situations where no prompting words are needed by default, or add the prompting words to the system's default prompting words.
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.
Research direction
Start with the ChatClient initialization where Skills are passed to defaultToolCallBacks(), then reproduce the blank-PDF request using the listed Spring AI and Spring Agent Skills versions. Compare the returned function name with the registered Skill tool; done when direct sub-skill names are handled correctly or the default prompting makes the intended Skill call reliable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- ai, api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100