spring-projects / spring-projects/spring-ai
Support observed tool execution outside of ChatClient
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 5
Description
DefaultToolCallingManager wraps tool calls with Micrometer observations (spring.ai.tool metrics, tool_call spans, exception recovery), but this logic is tightly coupled to the ChatClient/ChatModel tool loop and not reusable outside it.
Use cases that need observed tool execution without ChatClient:
- Raw provider SDK integrations
- Protocol bridges
Current workaround
We duplicate the observation-wrapping logic from https://github.com/spring-projects/spring-ai/blob/main/spring-ai-model/src/main/java/org/springframework/ai/model/tool/DefaultToolCallingManager.java into application code, so we can have the metrics, and ObservationHandler invoked when invoking the tools outside of ChatClient
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 spring-ai-model/src/main/java/org/springframework/ai/model/tool/DefaultToolCallingManager.java and trace how its observation wrapping is coupled to the ChatClient/ChatModel tool loop. Identify the reusable entry point needed for raw provider SDK integrations and protocol bridges. Done means external callers can obtain the existing tool metrics, spans, exception recovery, and ObservationHandler behavior without duplicating the logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100