hermes - 💡(How to fix) Fix [FR] Auto-switch transport to anthropic_messages when DeepSeek provider points to /anthropic endpoint [1 comments, 1 participants]

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…
GitHub stats
NousResearch/hermes-agent#20145Fetched 2026-05-06 06:38:23
View on GitHub
Comments
1
Participants
1
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×5closed ×1commented ×1

When provider: deepseek is combined with a base_url ending in /anthropic, Hermes should automatically resolve transport to anthropic_messages instead of the hardcoded openai_chat from the deepseek overlay.

DeepSeek's official docs (https://api-docs.deepseek.com/guides/anthropic_api) document an Anthropic-compatible endpoint at https://api.deepseek.com/anthropic. Users who follow these docs and configure Hermes accordingly get silently degraded behavior rather than the expected full Anthropic-protocol support.

Error Message

Currently this configuration is silently degraded rather than rejected or auto-corrected, which is a footgun for users following DeepSeek's official Anthropic-compatible endpoint docs. There is no error or warning — it just runs in degraded mode.

Root Cause

When provider: deepseek is combined with a base_url ending in /anthropic, Hermes should automatically resolve transport to anthropic_messages instead of the hardcoded openai_chat from the deepseek overlay.

DeepSeek's official docs (https://api-docs.deepseek.com/guides/anthropic_api) document an Anthropic-compatible endpoint at https://api.deepseek.com/anthropic. Users who follow these docs and configure Hermes accordingly get silently degraded behavior rather than the expected full Anthropic-protocol support.

Fix Action

Fix / Workaround

C. Config validator warns on the mismatch and suggests provider: anthropic with custom base_url as a workaround.

Code Example

model:
  provider: deepseek
  base_url: https://api.deepseek.com/anthropic
  model: deepseek-v4-flash
# Expected: transport=anthropic_messages
# Actual:   transport=openai_chat (from providers.py:123-126 overlay)
RAW_BUFFERClick to expand / collapse

Summary

When provider: deepseek is combined with a base_url ending in /anthropic, Hermes should automatically resolve transport to anthropic_messages instead of the hardcoded openai_chat from the deepseek overlay.

DeepSeek's official docs (https://api-docs.deepseek.com/guides/anthropic_api) document an Anthropic-compatible endpoint at https://api.deepseek.com/anthropic. Users who follow these docs and configure Hermes accordingly get silently degraded behavior rather than the expected full Anthropic-protocol support.

Current Behavior (verified in source)

  1. _is_deepseek_anthropic_endpoint() already exists (agent/anthropic_adapter.py:438)
  2. _endpoint_speaks_anthropic_messages() recognizes /anthropic URLs (agent/auxiliary_client.py:890)
  3. ✅ Thinking block handling has a dedicated DeepSeek branch (PR #16748)
  4. ❌ But hermes_cli/providers.py:123-126 deepseek overlay hardcodes transport: openai_chat, overriding the endpoint detection
  5. agent/auxiliary_client.py transport resolution doesn't follow the main slot's auto-detection for aux slots

Why this matters (silent degradation)

Users following DeepSeek's official docs configure base_url: https://api.deepseek.com/anthropic expecting full Anthropic-protocol features, but get:

  • Thinking blocks partially handled (saved by #16748 for the main agent)
  • cache_control injection skipped → future prompt-cache support DOA
  • Aux slot (compression / hindsight / summarizer) still on openai_chat → asymmetric protocol behavior across one logical session

Currently this configuration is silently degraded rather than rejected or auto-corrected, which is a footgun for users following DeepSeek's official Anthropic-compatible endpoint docs. There is no error or warning — it just runs in degraded mode.

Minimal repro config

model:
  provider: deepseek
  base_url: https://api.deepseek.com/anthropic
  model: deepseek-v4-flash
# Expected: transport=anthropic_messages
# Actual:   transport=openai_chat (from providers.py:123-126 overlay)

Proposed solutions (in order of preference)

A. DeepSeek overlay auto-detects transport from base_url suffix — when base_url ends with /anthropic, resolve transport=anthropic_messages instead of the hardcoded openai_chat. This mirrors how _endpoint_speaks_anthropic_messages() already works for the aux client.

B. DeepSeek overlay declares dual transport, routed by base_url.

C. Config validator warns on the mismatch and suggests provider: anthropic with custom base_url as a workaround.

Files involved

  • hermes_cli/providers.py — deepseek overlay (primary fix location, line 123-126)
  • agent/auxiliary_client.py — aux slot transport resolution must mirror main slot's auto-detection; otherwise the main conversation uses Anthropic protocol but compression/session-search/skills-hub still call openai_chat, negating the benefit
  • agent/run_agent.py::_anthropic_prompt_cache_policy() — future extension point, no change needed today; flagged for when DeepSeek's /anthropic endpoint adds cache_control support (currently listed as "Ignored" in their compatibility matrix)

Out of scope

  • Changes to other providers' transport selection
  • Implementing prompt-cache pricing/discount logic (server-side concern)
  • Modifying _anthropic_prompt_cache_policy() current behavior

extent analysis

TL;DR

Update the DeepSeek overlay in hermes_cli/providers.py to auto-detect transport from the base_url suffix, resolving transport=anthropic_messages when the URL ends with /anthropic.

Guidance

  • Review the hermes_cli/providers.py file, specifically lines 123-126, to understand the current hardcoded transport: openai_chat behavior.
  • Consider implementing solution A from the proposed solutions, which involves modifying the DeepSeek overlay to auto-detect transport based on the base_url suffix.
  • Verify that the _endpoint_speaks_anthropic_messages() function in agent/auxiliary_client.py correctly recognizes /anthropic URLs and adjust the transport resolution accordingly.
  • Ensure that the aux slot transport resolution in agent/auxiliary_client.py mirrors the main slot's auto-detection to maintain consistent protocol behavior.

Example

No code snippet is provided as the necessary changes are specific to the hermes_cli/providers.py file and require a thorough understanding of the existing codebase.

Notes

The proposed solutions aim to address the silent degradation issue when using the DeepSeek provider with an anthropic-ending base_url. However, the optimal solution may depend on the specific requirements and constraints of the project.

Recommendation

Apply workaround A, which involves updating the DeepSeek overlay to auto-detect transport from the base_url suffix, as it is the most straightforward and effective solution to address the silent degradation issue.

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