Skip to content

fix(minimax): normalize unsigned thinking block starts#2706

Open
rixzkiye wants to merge 1 commit into
decolua:masterfrom
rixzkiye:fix/minimax-thinking-signature
Open

fix(minimax): normalize unsigned thinking block starts#2706
rixzkiye wants to merge 1 commit into
decolua:masterfrom
rixzkiye:fix/minimax-thinking-signature

Conversation

@rixzkiye

Copy link
Copy Markdown
Contributor

Summary

  • add the required empty signature field when MiniMax omits it from Anthropic thinking block-start events
  • scope normalization through a provider quirk enabled only for minimax and minimax-cn
  • preserve existing block signatures and later signature_delta events unchanged
  • cover fragmented SSE chunks and provider isolation with regression tests

Problem

MiniMax can stream an Anthropic event shaped like:

{
  "type": "content_block_start",
  "content_block": { "type": "thinking", "thinking": "" }
}

Strict Messages clients deserialize signature on the block-start event before a later signature_delta arrives. Grok Build therefore aborts the turn with:

Internal error: "serialization error: missing field `signature`"

Anthropic-style thinking block starts use an empty signature placeholder; this PR adds only that missing envelope field. It does not synthesize or replace the provider signature.

Verification

  • regression reproduced before the fix: MiniMax block-start signature was undefined
  • cd tests && npx vitest run unit/minimax-thinking-signature.test.js unit/openai-responses-terminal-event.test.js unit/reasoningContentInjector.test.js unit/openai-to-claude-tools-no-type.test.js — 27 tests passed
  • fragmented SSE test preserves the real signature_delta
  • ESLint: 0 errors
  • production Next.js build: 130/130 pages generated
  • live local verification with Grok Build + minimax/MiniMax-M3: Claude-to-Claude streaming completed successfully with thinking enabled and 26 tools

Related

Companion transport/body alignment fix: #2705. No existing issue matching the client-side missing-signature serialization error was found.

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