[PR #8248] fix: avoid Anthropic tool-history requests without tools #12674

Open
opened 2026-02-16 18:17:34 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8248

State: open
Merged: No


What does this PR do?

Fixes Anthropic/LiteLLM proxies rejecting requests when message history contains tool calls but tools param is empty.
Adds a dummy tool when:

How did you verify your code works?

  • bun run tsc --noEmit passes
  • Tested with LiteLLM gateway: tool-history requests now succeed
  • Existing tests unaffected (557 pass, 95 fail - same as baseline)
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8248 **State:** open **Merged:** No --- ### What does this PR do? Fixes Anthropic/LiteLLM proxies rejecting requests when message history contains tool calls but `tools` param is empty. Adds a dummy tool when: - Model is Anthropic/Claude - Message history has `tool-call` or `tool-result` - No tools provided The dummy tool is excluded from `activeTools` so it won't be invoked. Fixes #8246 Relates to #2915 ### How did you verify your code works? - `bun run tsc --noEmit` passes - Tested with LiteLLM gateway: tool-history requests now succeed - Existing tests unaffected (557 pass, 95 fail - same as baseline)
yindo added the pull-request label 2026-02-16 18:17:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12674