@@ -17,6 +17,7 @@ Provider names today:
1717- ` acpx ` : routes through any ACP-compatible coding agent via ` acpx `
1818- ` claude ` : shells out to Claude Code in print mode (` claude -p ` )
1919- ` grok ` : shells out to the xAI Grok Build CLI in headless mode (` grok --prompt-file ` )
20+ - ` minimax ` : calls the MiniMax OpenAI-compatible HTTP API directly
2021- ` opencode ` : shells out to ` opencode run --format json `
2122- ` pi ` : shells out to ` pi -p ` (non-interactive print mode)
2223- ` cursor ` : shells out to ` cursor-agent -p --output-format json `
@@ -324,7 +325,54 @@ uses `--force` or `--yolo`. Complete HITL verification before promoting this to
324325default provider support, especially for ambient rules, MCP configuration,
325326temporary prompt file handling, timeout behavior, and any claimed read-only mode.
326327
327- Direct OpenAI API, local-model, and multi-model panel providers are not
328- implemented yet. The ` acpx ` provider is the generic route for ACP-compatible
329- agents; the ` grok ` , ` opencode ` , ` pi ` , and ` cursor ` providers are direct integrations
330- for local CLIs.
328+ ## MiniMax
329+
330+ The ` minimax ` provider calls the MiniMax OpenAI-compatible HTTP API directly. It
331+ requires a Token Plan API key in ` MINIMAX_API_KEY ` and defaults to
332+ ` https://api.minimax.io/v1 ` .
333+
334+ ``` bash
335+ export MINIMAX_API_KEY=sk-cp-...
336+ clawpatch doctor --provider minimax
337+ clawpatch review --provider minimax
338+ clawpatch review --provider minimax --model MiniMax-M2.7-highspeed
339+ ```
340+
341+ How the MiniMax provider works:
342+
343+ - Endpoint: ` POST ${MINIMAX_BASE_URL:-https://api.minimax.io/v1}/chat/completions `
344+ with ` Authorization: Bearer ${MINIMAX_API_KEY} ` . ` MINIMAX_BASE_URL ` is trimmed,
345+ normalized, and must use ` https ` unless it targets loopback HTTP for local
346+ development; the bearer token is sent to that configured endpoint.
347+ - Operations: ` map ` , ` review ` , and ` revalidate ` are supported. ` fix ` is not
348+ supported because the chat completions API cannot edit the worktree; it fails
349+ before checking credentials or making network calls with ` unsupported-provider `
350+ and exit code 2.
351+ - Structured output: MiniMax M-series Chat Completions do not document OpenAI
352+ ` response_format.json_schema ` support. Clawpatch therefore sends the provider
353+ schema in the prompt, disables M3 thinking with ` thinking: {type: "disabled"} ` ,
354+ asks for ` reasoning_split ` , extracts the returned JSON, and validates it
355+ locally with the same Zod schemas used by other providers.
356+ - Model selection: ` --model <name> ` sets the request ` model ` ; otherwise
357+ ` MINIMAX_MODEL ` is used, then ` MiniMax-M3 ` .
358+ - HTTP failures: ` 401 ` and ` 403 ` map to exit code 4, ` 429 ` maps to exit code 5,
359+ and other non-2xx statuses map to exit code 1. Embedded MiniMax auth,
360+ rate-limit, balance, and usage-limit status codes are mapped the same way.
361+ Error bodies are reduced to safe status/type/code signals and byte counts.
362+ - Timeout: 30 minutes by default for provider calls, override with
363+ ` CLAWPATCH_MINIMAX_TIMEOUT_MS ` or ` CLAWPATCH_PROVIDER_TIMEOUT_MS ` . The ` /models `
364+ doctor probe uses a 30-second timeout. Clawpatch uses a custom undici
365+ dispatcher and an operation abort signal so socket headers/body timeouts and
366+ full response-body reads track the configured timeout.
367+ - Bounds: request bodies over 64 MiB and responses over 10 MiB fail before
368+ parsing; error bodies are capped separately.
369+
370+ Permission caveat: MiniMax is a remote API provider. Review inputs are sent to
371+ the configured MiniMax endpoint, and read-only behavior depends on the remote
372+ model following the prompt. For untrusted code, run clawpatch in an isolated
373+ checkout and avoid sending secret-bearing files.
374+
375+ Direct local-model and multi-model panel providers are not implemented yet. The
376+ ` acpx ` provider is the generic route for ACP-compatible agents; the ` grok ` ,
377+ ` opencode ` , ` pi ` , and ` cursor ` providers are direct integrations for local CLIs;
378+ the ` minimax ` provider is a direct integration for the MiniMax HTTP API.
0 commit comments