something funky here
# proj-agent
w
something funky here
Copy code
litellm.BadRequestError: Error code: 400 - {'error': {'message': 'litellm.BadRequestError: AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"messages.132.content.1: each tool_use must have a single result. Found multiple `tool_result` blocks with id: toolu_01CmDy3yzsqQZrARkJWBZYwt"},"request_id":"req_011CYNPQBJEbEu2JRSZmc7HV"}No fallback model group found for original model_group=prod/claude-opus-4-5-20251101. Fallbacks=[{\'qwen3-coder-480b\': [\'qwen3-coder-480b-or\']}, {\'glm-4.5\': [\'glm-4.5-or\']}]. Received Model Group=prod/claude-opus-4-5-20251101\nAvailable Model Group Fallbacks=None\nError doing the fallback: litellm.BadRequestError: AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"messages.132.content.1: each tool_use must have a single result. Found multiple `tool_result` blocks with id: toolu_01CmDy3yzsqQZrARkJWBZYwt"},"request_id":"req_011CYNPQBJEbEu2JRSZmc7HV"}No fallback model group found for original model_group=prod/claude-opus-4-5-20251101. Fallbacks=[{\'qwen3-coder-480b\': [\'qwen3-coder-480b-or\']}, {\'glm-4.5\': [\'glm-4.5-or\']}] LiteLLM Retried: 2 times, LiteLLM Max Retries: 2', 'type': None, 'param': None, 'code': '400'}}
View Less
l
Yeah we're aware of this and Calvin is taking a look...
👍 1
w
this is probably incident-level, it's killing ~60% of my conversations
actually maybe I'm just unlucky because it's always on software-agent-sdk tests
l
Is it because your runtime is dying?
w
it does seem like the runtime dies too, and won't come back
l
Sorry, to clarify, I think these errors maybe happen when your runtime dies. The core cause is that a tool call is made but the tool response is not returned, and claude dies when you have an unmatched tool call ID in the prompt with no response. That’s what Calvin is working on fixing
aha 1
The runtime dying and not coming back is a known bug, and I think Tim fixed it on Monday but it’s not released yet
👍 1
w
@wide-doctor-37830 I just reproed in an env where the runtime is fine. Running software-agent-sdk tests seems to trigger it very easily
w
In this case it looks like the result of the tool call is coming in twice. I haven't found the root cause yet, our best guess is that it was related to runtimes dying but if Tim has addressed that and the problem still exists then I need to do more digging.
I haven't been able to repro the issue without a runtime crash.
w
FWIW I was running the agent-server directly on a VM
is tim's fix in prod?
w
I believe so, but I'm not sure of the exact PR. Think it was several runtime stability fixes.
I think we have a better sense of the problem now though. Issue seems to be when timeouts are hit or the conversation is restarted, we mark tool calls without matching observations with an error event that has the same tool call ID. But if the tool finishes running after that happens, we still add the observation to the event stream and that results in the error message you see.
👍 1
There are a few fixes we're working on but none of them are perfect: • I've been sketching out a compliance monitor that will stop those bad events from being added in the first place, but it's a really heavy-handed fix that might cause other strange behavior by blocking events we don't currently: https://github.com/OpenHands/software-agent-sdk/pull/2204 • Xingyao has a fix that replaces the error event with the observation, but it only works if they're in the same view and may have problems when the tool call observation comes in really late: https://github.com/OpenHands/software-agent-sdk/pull/2256
w
ok awesome, glad we're on it!
FWIW I'm no longer able to repro in prod, so maybe the bleeding has mostly stopped?
🤞 2