fix(minimax): wire api_key via apiKeyHelper, never via env

Mirrors agent-runtimes commit 1b83c81. CRS serves these harness files
to dispatchers, so this repo must match for the fix to take effect.

The minimax harness now writes ~/.claude/settings.json with an
apiKeyHelper that `cat`s the ESO-mounted /run/agent/secrets/minimax/
api_key file. Claude Code routes apiKeyHelper output to
`Authorization: Bearer <value>` for non-anthropic.com base URLs, which
is what MiniMax's /anthropic proxy requires. The secret is never read
into env, never written into a config file, and ESO rotation is
auto-recovered via Claude Code's per-session helper invocation
(also re-runs after a 401).

- harness.yaml: drop ANTHROPIC_AUTH_TOKEN_FILE env var
- init.sh: write (or jq-merge) settings.json with apiKeyHelper, chmod 0600
- bin/anthropic-compat-wrapper.sh: deleted

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-05-07 13:14:21 +12:00
parent dcdc6b5e0a
commit cb1b411276
3 changed files with 49 additions and 18 deletions

View File

@@ -5,9 +5,11 @@ description: "MiniMax coding plan — Anthropic-compatible proxy"
requires: []
provides: [claude-code]
# Auth is wired by init.sh via Claude Code's apiKeyHelper (settings.json).
# No credential env vars: the secret stays in the mounted file and is read
# only by the helper command at request time.
env:
ANTHROPIC_BASE_URL: "https://api.minimax.io/anthropic"
ANTHROPIC_AUTH_TOKEN_FILE: "/run/agent/secrets/minimax/api_key"
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS: "1"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: "1"
DISABLE_PROMPT_CACHING: "1"