hermes - 💡(How to fix) Fix [Bug]: cross-provider switch from MiniMax to Anthropic fails with Invalid signature in thinking block; the "stripped all thinking blocks, retrying" path does not actually remove the block.

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

✓ Model switched: claude-opus-4-7 Provider: Anthropic Context: 1,000,000 tokens Max output: 128,000 tokens

⚠️ Thinking block signature invalid — stripped all thinking blocks, retrying... ⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400] Provider: anthropic Model: claude-opus-4-7 Endpoint: https://api.anthropic.com Error: HTTP 400: messages.1.content.7: Invalid signature in thinking block Details: {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.1.content.7: Invalid signature in thinking block'}, 'request_id': 'req_011CaxpMs5YJTMSpYFCX9d7k'} ⚠️ API call failed (attempt 2/3): ... request_id: req_011CaxpN4QRd8dCmChPskBoq ⚠️ API call failed (attempt 3/3): ... request_id: req_011CaxpNSWx6PQhZ9UQGQUdf ⚠️ Max retries (3) exhausted — trying fallback... ❌ API failed after 3 retries — HTTP 400: messages.1.content.7: Invalid signature in thinking block

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

Workaround

Code Example

Model switched: claude-opus-4-7
    Provider: Anthropic
    Context: 1,000,000 tokens
    Max output: 128,000 tokens

⚠️  Thinking block signature invalid — stripped all thinking blocks, retrying...
⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   Provider: anthropic  Model: claude-opus-4-7
   Endpoint: https://api.anthropic.com
   Error: HTTP 400: messages.1.content.7: Invalid `signature` in `thinking` block
   Details: {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.1.content.7: Invalid `signature` in `thinking` block'}, 'request_id': 'req_011CaxpMs5YJTMSpYFCX9d7k'}
⚠️  API call failed (attempt 2/3): ... request_id: req_011CaxpN4QRd8dCmChPskBoq
⚠️  API call failed (attempt 3/3): ... request_id: req_011CaxpNSWx6PQhZ9UQGQUdf
⚠️ Max retries (3) exhausted — trying fallback...
API failed after 3 retries — HTTP 400: messages.1.content.7: Invalid `signature` in `thinking` block

---

Debug report uploaded:
  Report       https://paste.rs/gbWiP
  agent.log    https://paste.rs/BKf6g
  gateway.log  https://paste.rs/nTCF9

---
RAW_BUFFERClick to expand / collapse

Bug Description

Summary

Switching models from a MiniMax model to claude-opus-4-7 (Anthropic) causes every subsequent turn in the existing conversation to fail with Invalid signature in thinking block. The strip-and-retry fallback logs that it stripped the offending blocks, but the retry fails at the same content index with the identical error, so the strip is not actually mutating the payload that gets re-sent.

Log output

✓ Model switched: claude-opus-4-7
    Provider: Anthropic
    Context: 1,000,000 tokens
    Max output: 128,000 tokens

⚠️  Thinking block signature invalid — stripped all thinking blocks, retrying...
⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   Provider: anthropic  Model: claude-opus-4-7
   Endpoint: https://api.anthropic.com
   Error: HTTP 400: messages.1.content.7: Invalid `signature` in `thinking` block
   Details: {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.1.content.7: Invalid `signature` in `thinking` block'}, 'request_id': 'req_011CaxpMs5YJTMSpYFCX9d7k'}
⚠️  API call failed (attempt 2/3): ... request_id: req_011CaxpN4QRd8dCmChPskBoq
⚠️  API call failed (attempt 3/3): ... request_id: req_011CaxpNSWx6PQhZ9UQGQUdf
⚠️ Max retries (3) exhausted — trying fallback...
❌ API failed after 3 retries — HTTP 400: messages.1.content.7: Invalid `signature` in `thinking` block

Workaround

/new (or /reset) clears the offending blocks and the new provider works fine on a fresh conversation. /compress may also work but I have not verified.

Anthropic request IDs (for server-side correlation)

  • req_011CaxpMs5YJTMSpYFCX9d7k
  • req_011CaxpN4QRd8dCmChPskBoq
  • req_011CaxpNSWx6PQhZ9UQGQUdf

Steps to Reproduce

Reproduction

  1. Start a conversation using a MiniMax model that emits reasoning/thinking content.
  2. Have at least one assistant turn so reasoning content is stored in history.
  3. Run /model anthropic:claude-opus-4-7 (model switch reports success).
  4. Send any user message.
  5. Every retry attempt fails; the conversation is unusable until /new or /reset.

Expected Behavior

Expected behavior

Either (a) cross-provider model switches should strip any thinking/reasoning blocks that did not originate from the new target provider before the first request, or (b) when the API returns Invalid signature in thinking block, the strip-and-retry path should actually remove the block from the payload used by the retry.

Actual Behavior

Actual behavior

The error recurs identically across all 3 retries, all pointing at the same content index, suggesting the retry is rebuilding the request body from the unstripped history rather than from a stripped copy.

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

Debug report uploaded:
  Report       https://paste.rs/gbWiP
  agent.log    https://paste.rs/BKf6g
  gateway.log  https://paste.rs/nTCF9

Operating System

24.04.1-Ubuntu SMP

Python Version

Python: 3.11.15

Hermes Version

Hermes Agent v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING