Skip to content

Compaction fails on Bedrock-backed providers: missing toolConfig #34089

Description

@sledigabel

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

  1. Configure an @ai-sdk/openai-compatible provider backed by Bedrock (e.g. Portkey with x-portkey-config routing to Bedrock)
  2. Use a session using tools (or type something like "check git")
  3. Trigger compaction (/compact)
  4. Observe the Bedrock error

Screenshot and/or share link

Image

Operating System

macOS 26.5

Terminal

Ghostty

Related issues

may relate to #29428

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions