Add MiniMax model parsing - #227
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
📝 WalkthroughWalkthroughChangesThe 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
Suggested labels: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
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: 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
📒 Files selected for processing (2)
src/shared/utils/modelParser.tstest/shared/utils/modelParser.test.ts
| const miniMaxModel = MINIMAX_MODELS[normalized]; | ||
| if (miniMaxModel) { | ||
| return { ...miniMaxModel }; |
There was a problem hiding this comment.
🎯 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 -200Repository: 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 }))
JSRepository: 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.
Reason: Parse current MiniMax model IDs so session model displays no longer omit them.
Changes:
Checks:
pnpm exec vitest run test/shared/utils/modelParser.test.tspnpm typecheckpnpm lintpnpm exec prettier --check src/shared/utils/modelParser.ts test/shared/utils/modelParser.test.tspnpm buildgit diff --checkSummary by CodeRabbit
New Features
Bug Fixes
Tests