hermes - ✅(Solved) Fix fix: use /anthropic endpoint for MiniMax-CN auxiliary tasks [3 pull requests, 1 comments, 2 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#17387Fetched 2026-04-30 06:48:00
View on GitHub
Comments
1
Participants
2
Timeline
10
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×5labeled ×4commented ×1

Root Cause

Root cause: The _to_openai_base_url() helper converts /anthropic/v1, but MiniMax's /v1 endpoint does not support these auxiliary tasks, resulting in 404 errors.

Fix Action

Solution

For providers in _ANTHROPIC_COMPAT_PROVIDERS (minimax, minimax-cn), preserve the original /anthropic base URL so that _maybe_wrap_anthropic() can correctly detect and use the Anthropic transport instead of being forced through the OpenAI-compatible /v1 wrapper.

This is a 2-location fix in agent/auxiliary_client.py:

  • _resolve_api_key_provider()
  • resolve_provider_client()
raw_base = _pool_runtime_base_url(entry, pconfig.inference_base_url) or pconfig.inference_base_url
# For Anthropic-compatible providers, keep the /anthropic endpoint so
# _maybe_wrap_anthropic can detect it and use the Anthropic transport.
if provider_id in _ANTHROPIC_COMPAT_PROVIDERS:
    base_url = raw_base
else:
    base_url = _to_openai_base_url(raw_base)

PR fix notes

PR #17401: fix(auxiliary_client): preserve /anthropic/v1 path for MiniMax provider

Description (problem / solution / changelog)

Bug: MiniMax /anthropic/v1 URL incorrectly rewritten to /v1

Problem

MiniMax 的 Anthropic-compatible endpoint 是 /anthropic/v1/messages(固定两段式路径)。

_to_openai_base_url() 函数错误地将其重写:

base_url: https://api.minimaxi.com/anthropic
_rewrite: 去掉 /anthropic → https://api.minimaxi.com/v1
实际请求: https://api.minimaxi.com/v1/messages → 404
正确路径:  https://api.minimaxi.com/anthropic/v1/messages → 200

Root Cause

auxiliary_client.py 第 322 行:

if url.endswith("/anthropic"):
    rewritten = url[: -len("/anthropic")] + "/v1"

/anthropic 错误地重写为 /v1,但 MiniMax 需要保留 /anthropic/v1 完整路径。

Fix

只在 URL 恰好以 /anthropic 结尾(且不含 /v1 后缀)时才重写:

if url.endswith("/anthropic") and not url.endswith("/anthropic/v1"):

Testing

修复后 MiniMax provider 正常工作,auxiliary client 请求发到正确的 /anthropic/v1/messages 端点。

Changed files

  • agent/auxiliary_client.py (modified, +10/-1)

PR #17467: fix(auxiliary): pass raw base_url to _maybe_wrap_anthropic for correct transport detection

Description (problem / solution / changelog)

Summary

Fixes HTTP 404 errors when using Anthropic-compatible providers (Kimi Coding, MiniMax) for auxiliary tasks (title generation, etc.).

Root Cause

_to_openai_base_url() rewrites Anthropic-protocol URLs to OpenAI-compatible format:

  • /anthropic/v1
  • /coding/coding/v1

However, _maybe_wrap_anthropic() needs the original URL to correctly detect whether the endpoint speaks Anthropic Messages protocol via _endpoint_speaks_anthropic_messages().

Before this fix:

  • MiniMax: /anthropic rewritten to /v1, then _endpoint_speaks_anthropic_messages(/v1) returned False → no Anthropic wrapping → 404 on /v1/chat/completions
  • Kimi Coding: /coding rewritten to /coding/v1, but _endpoint_speaks_anthropic_messages still matched due to /coding in URL, causing double /v1 confusion

After this fix:

  • OpenAI client uses the rewritten URL (correct for chat.completions)
  • _maybe_wrap_anthropic uses the raw URL for transport detection (correct for protocol selection)

Changes

In agent/auxiliary_client.py, 4 locations now preserve raw_base_url:

  1. _resolve_api_key_provider() — pool path
  2. _resolve_api_key_provider() — API key path
  3. resolve_provider_client() — named custom provider
  4. resolve_provider_client() — API-key providers

Test Plan

  • Verify title generation works with Kimi Coding provider
  • Verify auxiliary calls work with MiniMax provider
  • Ensure no regression for OpenAI-format providers

Related

Fixes the "⚠ Auxiliary title generation failed: HTTP 404" error reported when using api.kimi.com/coding or MiniMax as the auxiliary provider.

Changed files

  • agent/auxiliary_client.py (modified, +19/-13)

PR #17528: fix(agent): use /anthropic endpoint for MiniMax-CN auxiliary tasks

Description (problem / solution / changelog)

Closes #17387.

Summary

auxiliary_client._to_openai_base_url() unconditionally rewrites /anthropic/v1 so the OpenAI SDK can hit chat.completions. For most providers that's correct — MiniMax exposes both surfaces and the OpenAI-compatible one lives at /v1. But MiniMax-CN's /v1 endpoint does not support auxiliary tasks (title generation, context compression, summarization), so every aux request 404s.

MiniMax-CN only serves those endpoints via the /anthropic surface, and we already have an AnthropicAuxiliaryClient wrapper (_maybe_wrap_anthropic) ready to consume that shape.

Fix

Thread a provider= kwarg into _to_openai_base_url. When the provider is in _ANTHROPIC_COMPAT_PROVIDERS (currently {"minimax", "minimax-cn"}), skip the /anthropic → /v1 rewrite so _maybe_wrap_anthropic can detect and route through the Anthropic Messages API instead.

-def _to_openai_base_url(base_url: str) -> str:
+def _to_openai_base_url(base_url: str, *, provider: str = "") -> str:
     url = str(base_url or "").strip().rstrip("/")
+    if provider and provider in _ANTHROPIC_COMPAT_PROVIDERS:
+        return url  # preserve /anthropic — _maybe_wrap_anthropic will handle it
     if url.endswith("/anthropic"):
         rewritten = url[: -len("/anthropic")] + "/v1"
 

All 6 call sites in agent/auxiliary_client.py updated to pass the provider they already have in local scope. Behavior unchanged for every non-MiniMax provider; the existing rewrite still fires when provider="", "openai", "custom", etc.

Tests

Added TestToOpenaiBaseUrl in tests/agent/test_auxiliary_client.py with 7 regression cases:

  • default rewrite behavior (preserved)
  • provider-gated preservation for minimax and minimax-cn
  • empty-provider fallback (preserved)
  • trailing-slash normalization
  • unrelated provider (openai) still gets the rewrite

Local inline verification of the logic: 6/6 pass. (Full pytest run requires Python 3.10+; my local env is 3.9 so CI will cover the test suite.)

Verification path

With this PR, an aux request on MiniMax-CN ends up on /anthropic/messages via AnthropicAuxiliaryClient instead of /v1/chat/completions (404). Compression / title generation / summarization on minimax-cn should recover.

Files

  • agent/auxiliary_client.py: +10 / -3 (function signature + 6 call sites)
  • tests/agent/test_auxiliary_client.py: +87

Changed files

  • agent/auxiliary_client.py (modified, +22/-7)
  • tests/agent/test_auxiliary_client.py (modified, +75/-0)

Code Example

raw_base = _pool_runtime_base_url(entry, pconfig.inference_base_url) or pconfig.inference_base_url
# For Anthropic-compatible providers, keep the /anthropic endpoint so
# _maybe_wrap_anthropic can detect it and use the Anthropic transport.
if provider_id in _ANTHROPIC_COMPAT_PROVIDERS:
    base_url = raw_base
else:
    base_url = _to_openai_base_url(raw_base)
RAW_BUFFERClick to expand / collapse

Problem

Auxiliary tasks (title generation, compression, context summarization) fail with 404 when using the minimax-cn provider.

Root cause: The _to_openai_base_url() helper converts /anthropic/v1, but MiniMax's /v1 endpoint does not support these auxiliary tasks, resulting in 404 errors.

Solution

For providers in _ANTHROPIC_COMPAT_PROVIDERS (minimax, minimax-cn), preserve the original /anthropic base URL so that _maybe_wrap_anthropic() can correctly detect and use the Anthropic transport instead of being forced through the OpenAI-compatible /v1 wrapper.

This is a 2-location fix in agent/auxiliary_client.py:

  • _resolve_api_key_provider()
  • resolve_provider_client()
raw_base = _pool_runtime_base_url(entry, pconfig.inference_base_url) or pconfig.inference_base_url
# For Anthropic-compatible providers, keep the /anthropic endpoint so
# _maybe_wrap_anthropic can detect it and use the Anthropic transport.
if provider_id in _ANTHROPIC_COMPAT_PROVIDERS:
    base_url = raw_base
else:
    base_url = _to_openai_base_url(raw_base)

Testing

Verified that auxiliary tasks (title, compression, summarization) now succeed with minimax-cn provider instead of returning 404.

extent analysis

TL;DR

To fix the 404 errors for auxiliary tasks with the minimax-cn provider, modify the _resolve_api_key_provider() and resolve_provider_client() functions in agent/auxiliary_client.py to preserve the original /anthropic base URL for Anthropic-compatible providers.

Guidance

  • Identify the providers in _ANTHROPIC_COMPAT_PROVIDERS and ensure they are handled correctly in the _resolve_api_key_provider() and resolve_provider_client() functions.
  • Verify that the base_url is set to the original /anthropic endpoint for these providers, allowing _maybe_wrap_anthropic() to detect and use the Anthropic transport.
  • Test auxiliary tasks (title generation, compression, context summarization) with the minimax-cn provider to ensure they no longer return 404 errors.
  • Review the code changes in agent/auxiliary_client.py to ensure they align with the proposed solution.

Example

if provider_id in _ANTHROPIC_COMPAT_PROVIDERS:
    base_url = raw_base
else:
    base_url = _to_openai_base_url(raw_base)

Notes

This fix assumes that the _ANTHROPIC_COMPAT_PROVIDERS list is correctly defined and includes the minimax-cn provider. Additionally, this solution may not apply to other providers or scenarios not mentioned in the issue.

Recommendation

Apply the workaround by modifying the _resolve_api_key_provider() and resolve_provider_client() functions as described, as this will allow auxiliary tasks to succeed with the minimax-cn provider.

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 - ✅(Solved) Fix fix: use /anthropic endpoint for MiniMax-CN auxiliary tasks [3 pull requests, 1 comments, 2 participants]