Update MiniMax provider defaults for MiniMax-M3#1032
Conversation
Use MiniMax-M3 as the provider default and align the Anthropic-compatible endpoint with MiniMax's /anthropic/v1 base so requests target the documented messages path. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@octo-patch is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR changes MiniMax’s default model from MiniMax-M2.7 to MiniMax-M3 across configuration, onboarding, provider defaults, and tests. It also normalizes MiniMax Anthropic-compatible base URLs and appends ChangesMiniMax model and endpoint update
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/minimax-provider.test.ts`:
- Line 16: Update the test lifecycle around the MINIMAX_BASE_URL mutations to
snapshot its original value before each test and restore it in afterEach,
deleting the variable when it was initially undefined. Apply this consistently
to the affected tests and preserve their existing setup behavior.
- Around line 23-28: Update MinimaxProvider.messagesUrl() to remove a trailing
/v1 from the configured MINIMAX_BASE_URL before appending /v1/messages, while
preserving handling of trailing slashes and unsuffixed URLs. Extend the existing
MiniMax URL tests with a regression case for a base URL ending in /v1 and expect
exactly one /v1/messages suffix.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 54c0f853-fcc9-49cb-97ec-540f9edd1b27
📒 Files selected for processing (3)
.env.examplesrc/providers/minimax.tstest/minimax-provider.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/providers/minimax.ts
- .env.example
|
|
||
| it("defaults to https://api.minimax.io/anthropic (not the legacy minimaxi.com host)", () => { | ||
| it("defaults to MiniMax's Anthropic-compatible base URL", () => { | ||
| delete process.env["MINIMAX_BASE_URL"]; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Restore MINIMAX_BASE_URL after each test.
These tests mutate the process-wide environment without restoring its previous value, so later tests can become order-dependent or inherit the custom URL. Snapshot and restore the variable in afterEach (including the originally-undefined case).
Also applies to: 24-25, 32-33
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/minimax-provider.test.ts` at line 16, Update the test lifecycle around
the MINIMAX_BASE_URL mutations to snapshot its original value before each test
and restore it in afterEach, deleting the variable when it was initially
undefined. Apply this consistently to the affected tests and preserve their
existing setup behavior.
| it("appends /v1/messages to MINIMAX_BASE_URL", () => { | ||
| process.env["MINIMAX_BASE_URL"] = "https://custom.example.com/anthropic/"; | ||
| const provider = new MinimaxProvider("test-key", "MiniMax-M3", 800); | ||
| expect((provider as unknown as { messagesUrl: () => string }).messagesUrl()).toBe( | ||
| "https://custom.example.com/anthropic/v1/messages", | ||
| ); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== file list =="
git ls-files 'src/providers/minimax.ts' 'test/minimax-provider.test.ts' 'test/crystallize.test.ts'
echo
echo "== relevant source outline =="
ast-grep outline src/providers/minimax.ts --view expanded || true
echo
echo "== relevant test outline =="
ast-grep outline test/minimax-provider.test.ts --view expanded || true
echo
echo "== source excerpt =="
sed -n '1,220p' src/providers/minimax.ts | cat -n
echo
echo "== test excerpt =="
sed -n '1,220p' test/minimax-provider.test.ts | cat -n
echo
echo "== search for /v1/messages and base URL handling =="
rg -n 'v1/messages|BASE_URL|messagesUrl|MINIMAX_BASE_URL' src testRepository: rohitg00/agentmemory
Length of output: 10942
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== MiniMax docs and references =="
rg -n -C 2 'MINIMAX_BASE_URL|MiniMax|minimax' README.md docs src test .github || true
echo
echo "== nearby provider normalization patterns =="
sed -n '1,220p' src/providers/openai.ts | cat -n
echo
sed -n '1,240p' src/providers/_openai-shared.ts | cat -nRepository: rohitg00/agentmemory
Length of output: 27509
Handle /v1-suffixed MiniMax base URLs. src/providers/minimax.ts:messagesUrl() always appends /v1/messages, so MINIMAX_BASE_URL=https://custom.example.com/anthropic/v1 becomes /v1/v1/messages. Add a regression test for that case and strip a trailing /v1 before appending the route.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/minimax-provider.test.ts` around lines 23 - 28, Update
MinimaxProvider.messagesUrl() to remove a trailing /v1 from the configured
MINIMAX_BASE_URL before appending /v1/messages, while preserving handling of
trailing slashes and unsuffixed URLs. Extend the existing MiniMax URL tests with
a regression case for a base URL ending in /v1 and expect exactly one
/v1/messages suffix.
|
This work has moved to #1056 with a clean signed-off commit from current main. The replacement includes the URL normalization fixes, regional protocol documentation, and updated request coverage. |
Reason: add target provider/model to existing provider registry
Summary
/anthropicand avoids appending an extra/v1segment when building the messages URL.Test plan
npm installnpm test -- --run test/minimax-provider.test.ts test/fallback-model-resolution.test.ts test/fetch-timeout.test.tsnpm run build🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests