You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LiteLLM error: Anthropic doesn't support tool calling without tools= param specified #2915
I'm running into some issues related to my provider: LiteLLM proxy. I realize this is a somewhat niche case, sorry 😬. See my config below.
Is this somehow something I can resolve client side?
AI_APICallError: litellm.UnsupportedParamsError: Anthropic doesn't support tool calling without tools= param specified. Pass tools= param OR set litellm.modify_params = True // litellm_settings::modify_params: True to add dummy tool to the request.
I might have been too quick to come to conclusions. I turned off thinking mode because this LiteLLM proxy distributes between Google Vertex and AWS Bedrock and it seems when forwarding to Vertex thinking mode was giving an error.
(I left a comment on a closed, seemingly sorta related issue #2599 (comment))
After turning thinking mode off I was back to not getting those tools related error messages and continued work. But later in the day the error messages returned.
What might have happened is that earlier in the day the issue was still there, but LiteLLM was falling back / retrying on Vertex (Bedrock is our main provider) and since thinking was now disabled those requests would succeed. We might have simply run out of Vertex capacity later that day.
What’s interesting is that whenever I get this error and I just type “go” the agent seems fine to just carry on. But that might again just be related to capacity on Google Vertex I suppose…
Anyway, I probably need to do some more digging to figure out what’s happening.
Is there some way to enable a nice HTTP log? That way I can inspect the request that resulted in this issue. I’ve tried log level DEBUG but that doesn’t seem to be it.
I am also encountering this issue. This appears to occur consistently when the session is compressed either manually or automatically upon reaching the context limit. Otherwise, the system functions flawlessly. Given that it appears to be triggered by compression, it does not appear to be related to using the Lite LLM Proxy.
I wanted to give you a heads up about the configuration. This is the main agent that uses subagents. I'm wondering if there's anything to do with the subagent sessions?
When running without subagents manual compaction works fine.
Reacted by Mark Henderson, Bo Xing and Yoonseok Kim
Unfortunately that didn't work. I'm going to reach out to our team that manages our Lite LLM Proxy. Thanks for trying to resolve. I'll share here if I find a way to resolve this.
A long time ago, Anthropic models would throw an error if you submitted a completions request w/ a message history containing tool calls & results - but don't pass in any tools. This is what happens during compaction, where we send the existing conversation history + a summary prompt, but disable all tools, i.e. completion([...existing_history_with_tools, summarize_prompt])
if (
"tools"notinoptional_paramsandmessagesisnotNoneandhas_tool_call_blocks(messages)
):
iflitellm.modify_params:
optional_params["tools"], _=self._map_tools(
add_dummy_tool(custom_llm_provider="anthropic")
)
else:
raiselitellm.UnsupportedParamsError(
message="Anthropic doesn't support tool calling without `tools=` param specified. Pass `tools=` param OR set `litellm.modify_params = True` // `litellm_settings::modify_params: True` to add dummy tool to the request.",
model="",
llm_provider="anthropic",
)
This is no longer the case (evidenced by the fact that compaction works fine via AI SDK). In the short term you can fix this on the LiteLLM side by running the proxy with modify_params=True, as the error message implies. This will add a dummy tool to the request in this case
I understand this is not an opencode problem directly but its hard to make changes on existing deployments in large companies. This is not the end of the world since a new session is usually fine to continue existing work but a workaround in the config would be nice, maybe a way to set a dummy tool in all calls so compaction works?
Activity
jessevdp commentedon Oct 2, 2025
It seems to only happen / error with the
thinkingoptions added.rekram1-node commentedon Oct 2, 2025
@jessevdp is your proxy dropping metadata? it seems like the issue is on your proxy rather than opencode.
If you turn on reasoning we need to keep the reasoning chunks otherwise anthropic with return error
jessevdp commentedon Oct 3, 2025
Thanks for getting back to me!
I might have been too quick to come to conclusions. I turned off thinking mode because this LiteLLM proxy distributes between Google Vertex and AWS Bedrock and it seems when forwarding to Vertex thinking mode was giving an error.
(I left a comment on a closed, seemingly sorta related issue #2599 (comment))
After turning thinking mode off I was back to not getting those
toolsrelated error messages and continued work. But later in the day the error messages returned.What might have happened is that earlier in the day the issue was still there, but LiteLLM was falling back / retrying on Vertex (Bedrock is our main provider) and since thinking was now disabled those requests would succeed. We might have simply run out of Vertex capacity later that day.
What’s interesting is that whenever I get this error and I just type “go” the agent seems fine to just carry on. But that might again just be related to capacity on Google Vertex I suppose…
Anyway, I probably need to do some more digging to figure out what’s happening.
Is there some way to enable a nice HTTP log? That way I can inspect the request that resulted in this issue. I’ve tried log level DEBUG but that doesn’t seem to be it.
rekram1-node commentedon Oct 3, 2025
hm dont think we do any http logs now? I feel like we used to do it may still be possible id have to check
mschenk42 commentedon Oct 25, 2025
I am also encountering this issue. This appears to occur consistently when the session is compressed either manually or automatically upon reaching the context limit. Otherwise, the system functions flawlessly. Given that it appears to be triggered by compression, it does not appear to be related to using the Lite LLM Proxy.
I wanted to give you a heads up about the configuration. This is the main agent that uses subagents. I'm wondering if there's anything to do with the subagent sessions?
When running without subagents manual compaction works fine.
rekram1-node commentedon Oct 25, 2025
would it be fixed if we just passed an empty tools array when we compact?
mschenk42 commentedon Oct 27, 2025
Yeah, based on the error message that seems like it would resolve the problem.
rekram1-node commentedon Oct 27, 2025
ill try that
rekram1-node commentedon Oct 27, 2025
Should be fixed by: 0af4505
Will release soon
mschenk42 commentedon Oct 28, 2025
Unfortunately that didn't work. I'm going to reach out to our team that manages our Lite LLM Proxy. Thanks for trying to resolve. I'll share here if I find a way to resolve this.
rekram1-node commentedon Oct 28, 2025
thank you for heads up
hewliyang commentedon Nov 5, 2025
A long time ago, Anthropic models would throw an error if you submitted a completions request w/ a message history containing tool calls & results - but don't pass in any tools. This is what happens during compaction, where we send the existing conversation history + a summary prompt, but disable all tools, i.e.
completion([...existing_history_with_tools, summarize_prompt])https://github.com/BerriAI/litellm/blob/c45fad3855847715afaebba71926f8e84eb7b355/litellm/llms/anthropic/chat/transformation.py#L672-L686
This is no longer the case (evidenced by the fact that compaction works fine via AI SDK). In the short term you can fix this on the LiteLLM side by running the proxy with
modify_params=True, as the error message implies. This will add a dummy tool to the request in this casehttps://github.com/BerriAI/litellm/blob/c45fad3855847715afaebba71926f8e84eb7b355/litellm/utils.py#L6809-L6827
But obviously this is suboptimal because now your arguments can be massaged in unknown ways.
tldr: not an opencode problem, litellm has a lot of footguns
geoHeil commentedon Dec 29, 2025
For me, the native pass-through works much better
danielfrg commentedon Jan 13, 2026
I understand this is not an opencode problem directly but its hard to make changes on existing deployments in large companies. This is not the end of the world since a new session is usually fine to continue existing work but a workaround in the config would be nice, maybe a way to set a dummy tool in all calls so compaction works?
fix: handle dangling tool_use blocks for LiteLLM proxy compatibility
fix: handle dangling tool_use blocks for LiteLLM proxy compatibility