[PR #7222] fix: Add signature field to ReasoningPart #12306

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

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

State: closed
Merged: No


This PR adds the optional signature field to the ReasoningPart type to support thinking block signatures required by models like Claude.

Changes

  • Added signature: z.string().optional() to ReasoningPart in packages/opencode/src/session/message-v2.ts
  • Added signature: z.string().optional() to ReasoningPart in packages/opencode/src/session/message.ts
  • Updated toModelMessage function to include the signature when converting reasoning parts

Related Issue

Fixes issue #6418: "Error: Invalid signature in thinking block" when switching models from MiniMax/GLM to Claude

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7222 **State:** closed **Merged:** No --- This PR adds the optional `signature` field to the `ReasoningPart` type to support thinking block signatures required by models like Claude. ## Changes - Added `signature: z.string().optional()` to `ReasoningPart` in `packages/opencode/src/session/message-v2.ts` - Added `signature: z.string().optional()` to `ReasoningPart` in `packages/opencode/src/session/message.ts` - Updated `toModelMessage` function to include the signature when converting reasoning parts ## Related Issue Fixes issue #6418: "Error: Invalid signature in thinking block" when switching models from MiniMax/GLM to Claude
yindo added the pull-request label 2026-02-16 18:17:13 -05:00
yindo closed this issue 2026-02-16 18:17:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12306