Description
When using an OpenAI-compatible provider backed by AWS Bedrock (via Portkey), compaction fails with:
bedrock error: The toolConfig field must be defined when using toolUse and toolResult content blocks.
During compaction, opencode sends conversation history containing toolUse/toolResult blocks with tools: {}. Bedrock requires a toolConfig whenever messages contain tool content blocks.
A _noop tool injection workaround existed but was removed in 7f7eb2e (#26819) when LiteLLM fixed the issue upstream. The underlying Bedrock API constraint still applies for non-LiteLLM proxies.
Plugins
N/A
OpenCode version
v1.2.23+ (regression introduced in v1.2.23, v1.2.22 unaffected)
Steps to reproduce
- Configure an @ai-sdk/openai-compatible provider backed by Bedrock (e.g. Portkey with x-portkey-config routing to Bedrock)
- Use a session using tools (or type something like "check git")
- Trigger compaction (/compact)
- Observe the Bedrock error
Screenshot and/or share link
Operating System
macOS 26.5
Terminal
Ghostty
Related issues
may relate to #29428
Description
When using an OpenAI-compatible provider backed by AWS Bedrock (via Portkey), compaction fails with:
During compaction, opencode sends conversation history containing toolUse/toolResult blocks with tools: {}. Bedrock requires a toolConfig whenever messages contain tool content blocks.
A _noop tool injection workaround existed but was removed in 7f7eb2e (#26819) when LiteLLM fixed the issue upstream. The underlying Bedrock API constraint still applies for non-LiteLLM proxies.
Plugins
N/A
OpenCode version
v1.2.23+ (regression introduced in v1.2.23, v1.2.22 unaffected)
Steps to reproduce
Screenshot and/or share link
Operating System
macOS 26.5
Terminal
Ghostty
Related issues
may relate to #29428