Skip to content

Commit ae3e111

Browse files
committed
update failing test case
1 parent c594428 commit ae3e111

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ function normalizeMessages(
8585
// as thinking blocks to Anthropic without a signature and would cause a 400 error.
8686
// This is a defence-in-depth guard; the primary prevention is in message-v2.ts where
8787
// reasoning parts from a different model are skipped before reaching this point.
88-
if (model.api.npm === "@ai-sdk/anthropic" || model.api.npm === "@ai-sdk/amazon-bedrock") {
88+
// Only applies to reasoning-capable models: non-reasoning models don't produce signed
89+
// thinking blocks, so their reasoning parts don't need a signature.
90+
if (
91+
model.capabilities.reasoning &&
92+
(model.api.npm === "@ai-sdk/anthropic" || model.api.npm === "@ai-sdk/amazon-bedrock")
93+
) {
8994
msgs = msgs
9095
.map((msg) => {
9196
if (msg.role !== "assistant" || !Array.isArray(msg.content)) return msg

0 commit comments

Comments
 (0)