# NousResearch/hermes-agent · MiniMax Anthropic transport and prompt caching fixes

## Open now

- 0 issues, 1 PR open on GitHub.
- PR #18147: fix(agent): default MiniMax provider to anthropic_messages + correct base_url

These issues and pull requests address bugs in MiniMax's integration with the Anthropic messages transport, specifically around enabling prompt caching for MiniMax's own models and correcting provider defaults and capability registry entries.

## TL;DR

- 5 member(s): 0 open issue(s), 1 closed issue(s), 1 open PR(s), 1 merged PR(s), 2 PR(s) closed without merging.
- A fix was merged to main in PR #17425. Verify it addresses your case.
- **Recommended:** read PR #17425 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-17425`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.40`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #17332: \[Bug\]: Prompt caching silently disabled for MiniMax's own models (MiniMax-M2.7 etc.) on anthropic_messages transport

## Prior & competing PRs

- **#17333: fix(agent): enable prompt caching for MiniMax own models on anthropic_messages transport**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#17425: fix(minimax): enable Anthropic prompt caching for MiniMax's own models**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `run_agent.py`, `tests/run_agent/test_anthropic_prompt_cache_policy.py`
  - fix hunks:
  - `run_agent.py`

    ```diff
    @@ -2814,6 +2814,24 @@ def _anthropic_prompt_cache_policy(
                 # Third-party Anthropic-compatible gateway.
                 return True, True
     
    +        # MiniMax on its Anthropic-compatible endpoint serves its own
    +        # model family (MiniMax-M2.7, M2.5, M2.1, M2) with documented
    +        # cache_control support (0.1× read pricing, 5-minute TTL).  The
    +        # blanket is_claude gate above excludes these — opt them in
    +        # explicitly via provider id or host match so users on
    +        # provider=minimax / minimax-cn (or custom endpoints pointing at
    +        # api.minimax.io/anthropic / api.minimaxi.com/anthropic) get the
    +        # same cost reduction as Claude traffic.
    +        # Docs: https://platform.minimax.io/docs/api-reference/anthropic-api-compatible-cache
    +        if is_anthropic_wire:
    +            is_minimax_provider = provider_lower in {"minimax", "minimax-cn"}
    +            is_minimax_host = (
    +                base_url_host_matches(eff_base_url, "api.minimax.io")
    +                or base_url_host_matches(eff_base_url, "api.minimaxi.com")
    +            )
    +            if is_minimax_provider or is_minimax_host:
    +                return True, True
    +
             # Qwen/Alibaba on OpenCode (Zen/Go) and native DashScope: OpenAI-wire
             # transport that accepts Anthropic-style cache_control markers and
             # rewards them with real cache hits.  Without this branch
    ```
  - `tests/run_agent/test_anthropic_prompt_cache_policy.py`

    ```diff
    @@ -89,15 +89,75 @@ def test_minimax_claude_via_anthropic_messages(self):
             assert should is True, "Third-party Anthropic gateway with Claude must cache"
             assert native is True, "Third-party Anthropic gateway uses native cache_control layout"
     
    -    def test_third_party_without_claude_name_does_not_cache(self):
    -        # A provider exposing e.g. GLM via anthropic_messages transport — we
    -        # don't know whether it supports cache_control, so stay conservative.
    +    def test_third_party_anthropic_non_claude_unknown_provider_does_not_cache(self):
    +        # A provider exposing e.g. GLM via anthropic_messages transport from
    +        # a host we don't recognize — we don't know whether it supports
    +        # cache_control, so stay conservative.
    +        agent = _make_agent(
    +            provider="custom",
    +            base_url="https://some-unknown-gateway.example.com/anthropic",
    +            api_mode="anthropic_messages",
    +            model="glm-4.5",
    +        )
    +        assert agent._anthropic_prompt_cache_policy() == (False, False)
    +
    +
    +class TestMiniMaxAnthropicWire:
    +    """MiniMax's own model family on its Anthropic-compatible endpoint.
    +
    +    MiniMax documents cache_control support on ``/anthropic`` (0.1× read
    +    pricing, 5-minute TTL). Issue #17332: the blanket ``is_claude`` gate on
    +    the third-party-gateway branch left MiniMax-M2.7 etc. paying full input
    +    cost every turn. Allowlist MiniMax explicitly via provider id or host.
    +    """
    +
    +    def test_minimax_m27_on_provider_minimax_caches_native_layout(self):
    +        agent = _make_agent(
    +            provider="minimax",
    +            base_url="https://api.minimax.io/anthropic",
    +            api_mode="anthropic_messages",
    +            model="minimax-m2.7",
    +        )
    +        assert agent._anthropic_prompt_cache_policy() == (True, True)
    +
    +    def test_minimax_m25_on_provider_minimax_cn_caches_native_layout(self):
    +        agent = _make_agent(
    +            provider="minimax-cn",
    +            base_url="https://api.minimaxi.com/anthropic",
    +            api_mode="anthropic_messages",
    +            model="minimax-m2.5",
    +        )
    +        assert agent._anthropic_prompt_cache_policy() == (True, True)
    +
    +    def test_custom_provider_pointed_at_minimax_host_caches(self):
    +        # User wires a custom provider manually at MiniMax's Anthropic URL;
    +        # host match alone should be sufficient to enable caching.
             agent = _make_agent(
                 provider="custom",
                 base_url="https://api.minimax.io/anthropic",
                 api_mode="anthropic_messages",
                 model="minimax-m2.7",
             )
    +        assert agent._anthropic_prompt_cache_policy() == (True, True)
    +
    +    def test_minimax_host_china_endpoint_caches(self):
    +        agent = _make_agent(
    +            provider="custom",
    +            base_url="https://api.minimaxi.com/anthropic",
    +            api_mode="anthropic_messages",
    +            model="minimax-m2.1",
    +        )
    +        assert agent._anthropic_prompt_cache_policy() == (True, True)
    +
    +    def test_minimax_provider_on_openai_wire_does_not_cache(self):
    +        # chat_completions transport — MiniMax's cache_control support is
    +        # documented only for the /anthropic endpoint. Stay off.
    +        agent = _make_agent(
    +            provider="minimax",
    +            base_url="https://api.minimax.io/v1",
    +            api_mode="chat_completions",
    +            model="minimax-m2.7",
    +        )
             assert agent._anthropic_prompt_cache_policy() == (False, False)
     
     
    ```
- **#17339: fix(agent): capability registry for Anthropic prompt-cache support (#17332)**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `df0e97a16`, `#17332`
- **#18147: fix(agent): default MiniMax provider to anthropic_messages + correct base_url**. open
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
  - files: `.env.example`

## Fix status

- Merged to main in PR #17425 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-04-29`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `agent`
