-
Notifications
You must be signed in to change notification settings - Fork 119
feat(provider): add minimax provider for MiniMax Token Plan models #125
Copy link
Copy link
Closed
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Description
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.This issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.Issue quality rating does not apply to this item.
Type
Fields
Priority
None yet
Feature request: add
minimaxprovider for MiniMax Token Plan modelsSummary
Add a new clawpatch provider named
minimaxthat calls the MiniMaxOpenAI-compatible chat completions endpoint directly via
fetch(). Thisunblocks clawpatch users with a MiniMax Token Plan (or any other
minimax/MiniMax deployment) when their default provider (
codex) isunavailable or rate-limited, or when they prefer to use minimax/MiniMax for
reviews.
Motivation
codexdefault requires a local Codex CLI. Users who donot have Codex installed or authenticated have to fall back to
acpx(which routes through openclaw) or to one of the other local CLI
providers.
https://api.minimax.io/v1/chat/completionswith stable schema-enforcedoutput via
response_format.json_schema. This is a clean fit forclawpatch's per-call provider contract.
codex,acpx,claude,cursor,grok,opencode,pi,mock,mock-fail). Addingminimaxcovers a different distribution and is a real maintenanceburden shared with maintainers.
Proposed approach
Add a new
minimaxprovider insrc/provider.tsthat:MINIMAX_API_KEYenv var.${MINIMAX_BASE_URL:-https://api.minimax.io/v1}/chat/completionswith
model,messages, andresponse_format: {type: "json_schema", ...}.--model <name>(defaultMiniMax-M3).CLAWPATCH_MINIMAX_TIMEOUT_MSandCLAWPATCH_PROVIDER_TIMEOUT_MSfor the per-call timeout.
grokEnvelopeText-style envelope probing if the responseshape is non-standard.
A reference implementation is available on the fork at
ferminquant/clawpatchon branchfeat/minimax-provider.Configuration
MINIMAX_API_KEYsk-cp-…)MINIMAX_BASE_URLhttps://api.minimax.io/v1MINIMAX_MODELMiniMax-M3CLAWPATCH_MINIMAX_TIMEOUT_MS300000CLAWPATCH_PROVIDER_TIMEOUT_MS300000Endpoints
POST /chat/completions— review, fix, revalidate, mapGET /models— connectivity check (used bycheck())Verification on the reference implementation
pnpm typecheck— cleanpnpm lint— clean (1 unused-param warning fixed by renaming to_root)pnpm format:check— clean (afterpnpm format)pnpm test src/provider.test.ts— 146/146 passing (135 pre-existing + 11 new)pnpm build— cleanproviderByName("minimax").check(...)against the real/v1/modelsendpoint with a Token Plan key returnsprovider=minimax default-model=MiniMax-M3 base=https://api.minimax.io/v1feat_library_d4f04bd776(a realfeature in
ferminquant/budget) completed in 4m07s and produced 5schema-valid findings.
The full test suite has 19 pre-existing failures in
src/workflow.test.tsthat are unrelated to this change (verified by stashing the changes and
re-running the same test).
Labels
enhancement— new featurehelp wanted— community contribution welcomeimpact:other— provider routing / model choicemerge-risk: 🚨 auth-provider— touches the auth/credentials surfacedocumentation— README provider list needs updating