spring-projects / spring-projects/spring-ai
ToolResponseMessage responses is empty
Open
Nobody has claimed this yet.
status: waiting-for-triage
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Bug description
I am trying to manually add the tool call result to the session history, but the saved result is empty!
How should I handle it?
@Tool(description = "exit")
public String exit(ToolContext toolContext){
Object sessionId = toolContext.getContext().get("sessionId");
chatMemory.add((String) sessionId, ToolResponseMessage.builder().responses(List.of(new ToolResponseMessage.ToolResponse("id", "name", "data"))).build());
return "bye";
}
but I got:
ToolResponseMessage{responses=[], messageType=TOOL, metadata={messageType=TOOL}}
conversation_id content type timestamp
44c5e577-d99f-5306-1dbc-7421aa6317d0 TOOL 2025-12-03 18:57:26
Environment
SpringAI 1.1.0
JdbcChatMemoryRepository
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 ToolResponseMessage and the JdbcChatMemoryRepository path used by chatMemory.add, then reproduce the example with the supplied ToolResponse value. Trace how the tool response is serialized and restored, and verify that the saved history retains the response data instead of producing an empty responses list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100