spring-projects / spring-projects/spring-ai

Support observed tool execution outside of ChatClient

Open
#5,575 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.