#28778 [Bug]: When an agent with tools turns on either redis-semanticor qdrant-semantic cache mode and carries tool return JSON requests to the gateway, the tool return content will be lost.
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Observed Behavior After tool invocation, the agent began repeating requests. Logs confirmed that tool responses were correctly returned, so the issue was not an infinite loop. Root Cause Analysis The most probable cause is improper injection of tool results into the model context: the results lacked the required role=tooland corresponding tool_call_id. Langfuse Tracing Multiple ToolNodes were observed, each showing normal tool input and output. However, once execution returned to the parent Chat Model node, the tool outputs disappeared. Only the tool request and assistant tool_call_idremained. Hypothesis When tool invocation is combined with semantic similarity caching, tool response payloads are lost. The agent, seeing only the tool request, assumes the tool has not been executed and repeatedly issues new calls, resulting in persistent errors.
### Steps to Reproduce
1. create a simple agent with a tool 2. set up litellm on your machine with the following config: model_list: - model_name: tokenhub-deepseek-v4-pro litellm_params: …