hermes - 💡(How to fix) Fix Third-party relay (PackyAPI) + DeepSeek: thinking blocks stripped causing HTTP 400

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…

When using DeepSeek models (e.g. deepseek-v4-flash) through a third-party relay/proxy service (PackyAPI, https://www.packyapi.com) with thinking mode enabled, multi-turn tool calls fail with HTTP 400.

Error Message

⚠️ API call failed (attempt 1/3): BadRequestError [HTTP 400] 🔌 Provider: custom Model: deepseek-v4-flash 🌐 Endpoint: https://www.packyapi.com 📝 Error: HTTP 400: The content[].thinking in the thinking mode must be passed back to the API. 📋 Details: {'error': {'type': 'invalid_request_error', 'message': 'The content[].thinking in the thinking mode must be passed back to the API.'}, 'type': 'error'}

Root Cause

Same underlying issue as #17992 — in agent/anthropic_adapter.py:_preserve_unsigned_thinking(), thinking blocks with a truthy signature field are stripped. When these blocks are not preserved in the conversation history, the upstream API (DeepSeek, whether directly or through a relay) rejects the next request.

Code Example

⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: custom  Model: deepseek-v4-flash
   🌐 Endpoint: https://www.packyapi.com
   📝 Error: HTTP 400: The `content[].thinking` in the thinking mode must be passed back to the API.
   📋 Details: {'error': {'type': 'invalid_request_error', 'message': 'The `content[].thinking` in the thinking mode must be passed back to the API.'}, 'type': 'error'}
RAW_BUFFERClick to expand / collapse

Description

When using DeepSeek models (e.g. deepseek-v4-flash) through a third-party relay/proxy service (PackyAPI, https://www.packyapi.com) with thinking mode enabled, multi-turn tool calls fail with HTTP 400.

Error Log

⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: custom  Model: deepseek-v4-flash
   🌐 Endpoint: https://www.packyapi.com
   📝 Error: HTTP 400: The `content[].thinking` in the thinking mode must be passed back to the API.
   📋 Details: {'error': {'type': 'invalid_request_error', 'message': 'The `content[].thinking` in the thinking mode must be passed back to the API.'}, 'type': 'error'}

Steps to Reproduce

  1. Configure a custom provider pointing to https://www.packyapi.com with model deepseek-v4-flash and thinking mode enabled
  2. Start a conversation that triggers tool calls (e.g. web_search)
  3. On the second API call (after tool results come back), the error occurs

Expected Behavior

Tool calls should succeed across multiple turns without HTTP 400 errors.

Actual Behavior

The API returns HTTP 400 with the message The content[].thinking in the thinking mode must be passed back to the API., and Hermes reports a non-retryable error.

Root Cause

Same underlying issue as #17992 — in agent/anthropic_adapter.py:_preserve_unsigned_thinking(), thinking blocks with a truthy signature field are stripped. When these blocks are not preserved in the conversation history, the upstream API (DeepSeek, whether directly or through a relay) rejects the next request.

Environment

  • Provider: custom (PackyAPI relay)
  • Model: deepseek-v4-flash
  • Endpoint: https://www.packyapi.com
  • Relay service: PackyCode (中转)

Related

  • #17992 (same error with official DeepSeek API)
  • #17991 (open PR with proposed fix)

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

hermes - 💡(How to fix) Fix Third-party relay (PackyAPI) + DeepSeek: thinking blocks stripped causing HTTP 400