Skip to content

fix: clear thought_signature in DropReasoningDetails transformer#2751

Open
majiayu000 wants to merge 1 commit intoantinomyhq:mainfrom
majiayu000:fix/issue-2646-cross-provider-signature-leak
Open

fix: clear thought_signature in DropReasoningDetails transformer#2751
majiayu000 wants to merge 1 commit intoantinomyhq:mainfrom
majiayu000:fix/issue-2646-cross-provider-signature-leak

Conversation

@majiayu000
Copy link
Copy Markdown
Contributor

Summary

  • DropReasoningDetails only cleared reasoning_details but left thought_signature intact on text messages
  • When switching from a provider like MiniMax back to Claude, the leftover signature caused a 400 error because Claude rejects unknown thinking block signatures
  • Added text.thought_signature = None; alongside the existing text.reasoning_details = None; to match the behavior of ReasoningNormalizer which already clears both fields

Fixes #2646

Test plan

  • Added test_drop_reasoning_clears_thought_signature — creates an assistant message with both reasoning_details and thought_signature set, runs DropReasoningDetails, asserts both are None
  • All existing tests pass (cargo test --all-features --workspace)
  • RUSTFLAGS='-Dwarnings' cargo check --all-features --workspace passes

DropReasoningDetails only cleared reasoning_details but left
thought_signature intact. When switching from a provider like MiniMax
back to Claude, the leftover signature caused a 400 error because
Claude rejects unknown thinking block signatures.

ReasoningNormalizer already clears both fields on model change, but
DropReasoningDetails (used when the target model does not support
reasoning at all) missed the thought_signature field.

Signed-off-by: majiayu000 <1835304752@qq.com>
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.

[Bug]: Switching from one provider back to claude fails

1 participant