Skip to content

Add MiniMax model parsing - #227

Open
octo-patch wants to merge 1 commit into
matt1398:mainfrom
octo-patch:octo/20260801-provider-add-recvqjPH00tWIC
Open

Add MiniMax model parsing#227
octo-patch wants to merge 1 commit into
matt1398:mainfrom
octo-patch:octo/20260801-provider-add-recvqjPH00tWIC

Conversation

@octo-patch

@octo-patch octo-patch commented Aug 1, 2026

Copy link
Copy Markdown

Reason: Parse current MiniMax model IDs so session model displays no longer omit them.

Changes:

  • Recognize MiniMax-M3 and MiniMax-M2.7 in the shared model parser.
  • Preserve canonical display names and version metadata for both models.
  • Add focused parser tests for both current model IDs.

Checks:

  • pnpm exec vitest run test/shared/utils/modelParser.test.ts
  • pnpm typecheck
  • pnpm lint
  • pnpm exec prettier --check src/shared/utils/modelParser.ts test/shared/utils/modelParser.test.ts
  • pnpm build
  • git diff --check

Summary by CodeRabbit

  • New Features

    • Added support for recognizing MiniMax M3 and M2.7 model identifiers.
    • Improved model parsing documentation to cover supported models more generally.
  • Bug Fixes

    • Preserved existing validation and parsing behavior for unsupported and other model formats.
  • Tests

    • Added coverage for MiniMax model formats and unsupported model strings.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@coderabbitai coderabbitai Bot added the feature request New feature or request label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The model parser now supports MiniMax M3 and M2.7 metadata. It recognizes normalized MiniMax identifiers before Claude-specific parsing and includes tests for supported and unsupported model strings.

MiniMax model support

Layer / File(s) Summary
Model metadata and parsing
src/shared/utils/modelParser.ts
The parser defines metadata for minimax-m3 and minimax-m2.7, updates its documentation, and returns cloned metadata for matching identifiers.
Parser validation tests
test/shared/utils/modelParser.test.ts
Tests verify null for unsupported models and expected family and version fields for MiniMax M3 and M2.7 strings.

Suggested labels: feature request

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 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.

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

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@src/shared/utils/modelParser.ts`:
- Around line 58-60: Update the MiniMax lookup in the model parser around
MINIMAX_MODELS and normalized to accept only own properties, preventing
inherited keys such as constructor, toString, and __proto__ from entering the
truthy branch; add regression tests covering those inputs and verify they do not
return model metadata.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d067af5-a5cf-490e-9727-fca52a21a5a9

📥 Commits

Reviewing files that changed from the base of the PR and between 16cc3c8 and 1c4180b.

📒 Files selected for processing (2)
  • src/shared/utils/modelParser.ts
  • test/shared/utils/modelParser.test.ts

Comment on lines +58 to +60
const miniMaxModel = MINIMAX_MODELS[normalized];
if (miniMaxModel) {
return { ...miniMaxModel };

Copy link
Copy Markdown

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 "== locate modelParser =="
fd -a 'modelParser\.ts$' . || true

echo "== file excerpt =="
if [ -f src/shared/utils/modelParser.ts ]; then
  nl -ba src/shared/utils/modelParser.ts | sed -n '1,140p'
fi

echo "== usages of ModelInfo / parseModelInfo / MINIMAX_MODELS =="
rg -n "ModelInfo|parseModelInfo|MINIMAX_MODELS|modelParser" -S . --glob '!node_modules' --glob '!dist' --glob '!build' | head -200

Repository: matt1398/claude-devtools

Length of output: 297


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== file excerpt =="
awk '{ printf "%6d\t%s\n", NR, $0 }' src/shared/utils/modelParser.ts | sed -n '1,140p'

echo "== imports/exports and tests related to modelParser =="
rg -n "modelParser|MINIMAX_MODELS|getMinimal|parseModel|ModelInfo" -S . --glob '!node_modules' --glob '!dist' --glob '!build' | sed -n '1,220p'

echo "== behavioral probe for inherited-key lookup =="
node - <<'JS'
const MINIMAX_MODELS = {
  'minimax-01': { provider: 'MINIMAX', providerName: 'MiniMax' },
};
const normalized = 'constructor';
const miniMaxModel = MINIMAX_MODELS[normalized];
console.log(JSON.stringify({ normalized, hasOwnProperty: Object.prototype.hasOwnProperty.call(MINIMAX_MODELS, normalized), value: miniMaxModel, isEmpty: miniMaxModel != null && Object.keys(miniMaxModel).length === 0, truthyAndEmpty: !!(miniMaxModel) && Object.keys(miniMaxModel).length === 0 }))
JS

Repository: matt1398/claude-devtools

Length of output: 9803


Guard the MiniMax lookup against inherited keys.

MINIMAX_MODELS is a normal object; inputs like constructor, toString, or __proto__ can read inherited non-null properties into the truthy branch and return an empty ModelInfo. Use an own-property check or a Map, and add regression tests for these inputs.

🤖 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 `@src/shared/utils/modelParser.ts` around lines 58 - 60, Update the MiniMax
lookup in the model parser around MINIMAX_MODELS and normalized to accept only
own properties, preventing inherited keys such as constructor, toString, and
__proto__ from entering the truthy branch; add regression tests covering those
inputs and verify they do not return model metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant