Skip to content

Update MiniMax provider defaults for MiniMax-M3#1032

Closed
octo-patch wants to merge 2 commits into
rohitg00:mainfrom
octo-patch:octo/20260708-add-target-provider-model-to-existing-provider-registry-recvoNm9MGLgpp
Closed

Update MiniMax provider defaults for MiniMax-M3#1032
octo-patch wants to merge 2 commits into
rohitg00:mainfrom
octo-patch:octo/20260708-add-target-provider-model-to-existing-provider-registry-recvoNm9MGLgpp

Conversation

@octo-patch

@octo-patch octo-patch commented Jul 9, 2026

Copy link
Copy Markdown

Reason: add target provider/model to existing provider registry

Summary

  • Updates MiniMax provider defaults from MiniMax-M2.7 to MiniMax-M3.
  • Aligns the default Anthropic-compatible MiniMax base URL with /anthropic and avoids appending an extra /v1 segment when building the messages URL.
  • Refreshes related env examples, onboarding label, and provider tests.

Test plan

  • npm install
  • npm test -- --run test/minimax-provider.test.ts test/fallback-model-resolution.test.ts test/fetch-timeout.test.ts
  • npm run build
  • Secret scan on pending diff

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Updated the default MiniMax setup to use the newer MiniMax-M3 option during onboarding and when no model is explicitly configured.
    • Added support for the recommended MiniMax API endpoint format, including the Anthropic-compatible path.
  • Bug Fixes

    • Improved request handling so MiniMax connections use the correct message endpoint by default and with custom base URLs.
  • Tests

    • Updated coverage to match the new default model and endpoint behavior.

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>
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This 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 /v1/messages when constructing requests.

Changes

MiniMax model and endpoint update

Layer / File(s) Summary
MiniMax-M3 default model updates
.env.example, src/cli/onboarding.ts, src/config.ts, src/providers/index.ts, test/fallback-model-resolution.test.ts, test/fetch-timeout.test.ts
MiniMax model references and fallback expectations change from MiniMax-M2.7 to MiniMax-M3.
Anthropic-compatible endpoint construction
src/providers/minimax.ts
MINIMAX_BASE_URL is documented as an Anthropic-compatible base URL, and messagesUrl() trims trailing slashes before appending /v1/messages for requests.
Provider URL tests
test/minimax-provider.test.ts
Tests cover the default base URL, custom base URLs, and trailing-slash normalization while using MiniMax-M3.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: updating MiniMax provider defaults to MiniMax-M3.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f6c81b2 and f439a69.

📒 Files selected for processing (3)
  • .env.example
  • src/providers/minimax.ts
  • test/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"];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Comment on lines +23 to +28
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",
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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 test

Repository: 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 -n

Repository: 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.

@octo-patch

Copy link
Copy Markdown
Author

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.

@octo-patch octo-patch closed this Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant