Skip to content

Conversation

@usvimal
Copy link
Contributor

@usvimal usvimal commented Jan 7, 2026

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

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

Why they're related: Both PRs address compatibility issues when switching between different models and handling thinking/reasoning blocks. PR #6748 handles stripping incompatible thinking blocks when switching to Anthropic models, while PR #7222 adds signature field support for Claude. These changes may be related to the same issue (#6418) about model compatibility with thinking blocks.

@usvimal
Copy link
Contributor Author

usvimal commented Jan 7, 2026

Closing as superseded by #6748 which provides a more complete fix - stripping incompatible thinking blocks and converting reasoning to text when switching to Anthropic models.

@usvimal usvimal closed this Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant