fix(delegate): recognise MiniMax /anthropic endpoint in delegation - #7
Merged
Merged
Conversation
…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.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Test plan
Notes
This fix is independent of #6 (WS-AUTO-002 AFK Work Loop). No conflict expected at merge time.