Skip to content

fix(delegate): recognise MiniMax /anthropic endpoint in delegation - #7

Merged
MKheru merged 1 commit into
acos-mainfrom
fix/minimax-anthropic-delegation
May 4, 2026
Merged

fix(delegate): recognise MiniMax /anthropic endpoint in delegation#7
MKheru merged 1 commit into
acos-mainfrom
fix/minimax-anthropic-delegation

Conversation

@MKheru

@MKheru MKheru commented May 4, 2026

Copy link
Copy Markdown
Owner

Bug

When `delegation.base_url` is configured to MiniMax's Anthropic-compatible endpoint (`https://api.minimax.io/anthropic\` or `https://api.minimaxi.com/anthropic\`), `_resolve_delegation_credentials` falls back to:

```
provider=custom api_mode=chat_completions
```

Sub-agents then POST to `/v1/chat/completions` (OpenAI format) which doesn't exist on MiniMax → `HTTP 404: 404 page not found` after 3 retries.

Symptom

GPT-5.5 main agent (Codex provider) tries to delegate research tasks to MiniMax-M2.7 children via `delegate_task`. Every child fails:

```
[subagent-0] API call failed after 3 retries. HTTP 404: 404 page not found | provider=custom model=MiniMax-M2.7
```

Confirmed during WS9 GPT-5.5 evaluation 2026-05-04 ~13:55 UTC. Fallback path forced GPT-5.5 to do all 5 sub-tasks itself.

Fix

Add a 4th branch to the URL auto-detection in `_resolve_delegation_credentials` mapping `api.minimax.io` / `api.minimaxi.com` with `/anthropic` in the path to `provider=minimax` + `api_mode=anthropic_messages`. The child then builds a correct `POST /v1/messages` call at `/anthropic/v1/messages`.

10 lines added, no logic modified for existing branches.

Verification

After deploying the fix on acos-hermes-01, re-ran WS9 GPT-5.5 evaluation:

  • Batch 1 (SR1/SR2/SR3) → all 3 children completed via MiniMax
  • Batch 2 (SR4/SR5) → both completed
  • GPT-5.5 rejected SR3 + SR5 partially and re-delegated with targeted briefs (the orchestration test we wanted to run originally)
  • Total: 64 MiniMax API calls, ~27min wall-clock cumulative
  • Final livrable: `~/WS9_GUARDIAN_DESIGN_DEEP.md`, 412 lines

Test plan

  • Unit syntax check on `tools/delegate_tool.py`
  • Restart hermes-agent on VPS, no boot error
  • Live test: GPT-5.5 successfully delegates 5+ sub-tasks to MiniMax children
  • No regression on Codex/Anthropic/Kimi paths (only added a new `elif` branch)

Notes

This fix is independent of #6 (WS-AUTO-002 AFK Work Loop). No conflict expected at merge time.

…sages

When delegation.base_url is configured, _resolve_delegation_credentials
auto-detects provider/api_mode from the URL hostname. Codex, Anthropic
and Kimi were handled, but MiniMax's Anthropic-compatible endpoint
(api.minimax.io/anthropic, api.minimaxi.com/anthropic) was not — sub-
agents fell back to provider=custom + api_mode=chat_completions and
POSTed to /v1/chat/completions, which doesn't exist on MiniMax → HTTP
404 page not found after 3 retries.

Symptom in prod: GPT-5.5 main agent (Codex) tries to delegate research
sub-tasks to MiniMax-M2.7 children via delegate_task. Every child
returns 'API call failed after 3 retries. HTTP 404: 404 page not
found | provider=custom model=MiniMax-M2.7'. Confirmed during WS9
GPT-5.5 evaluation 2026-05-04 13:55-13:56 UTC.

Fix: add a 4th branch matching api.minimax.io / api.minimaxi.com with
'/anthropic' in the path, mapping it to provider=minimax and
api_mode=anthropic_messages. This makes the child build the correct
POST /v1/messages call at /anthropic/v1/messages.

The MiniMax model itself was already on prod via env:MINIMAX_API_KEY
in the credential pool — only the auto-detection was missing.
@MKheru
MKheru merged commit 5f35e76 into acos-main May 4, 2026
@MKheru
MKheru deleted the fix/minimax-anthropic-delegation branch May 4, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant