mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-17 04:17:11 +00:00
refactor(minimax): Rename to 'mm' for brevity
- Rename profile ID: minimax -> mm - Rename settings file: base-minimax.settings.json -> base-mm.settings.json - Update all code references - Remove review_pr.md documentation - Shorter CLI command: ccs mm instead of ccs minimax Rationale: - 'mm' is more concise (2 chars vs 7 chars) - Matches 'glm', 'kimi' short naming pattern - Improves UX for frequent switching
This commit is contained in:
@@ -1,122 +0,0 @@
|
||||
# Code Review: PR #250 - MiniMax M2.1 Support
|
||||
|
||||
**PR:** https://github.com/kaitranntt/ccs/pull/250
|
||||
**Author:** jellydn (Dung Duc Huynh)
|
||||
**Date:** 2026-01-02
|
||||
**Status:** Changes Requested
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
The PR adds full MiniMax M2.1 support to CCS, following the GLM implementation pattern. Changes include:
|
||||
- Settings template: `config/base-minimax.settings.json`
|
||||
- Model pricing: `src/web-server/model-pricing.ts`
|
||||
- API key validation: `src/utils/api-key-validator.ts`
|
||||
- Integration: `src/ccs.ts`
|
||||
|
||||
---
|
||||
|
||||
## Issues Found
|
||||
|
||||
### 1. ✅ FIXED: Model Name Case Mismatch
|
||||
|
||||
**Files:** `config/base-minimax.settings.json:8`, `src/web-server/model-pricing.ts:549`
|
||||
|
||||
**Problem:** The model name was inconsistent between files:
|
||||
- Settings: `MiniMax-M2.1-Lightning` (capital "L")
|
||||
- Pricing: `MiniMax-M2.1-lightning` (lowercase "l")
|
||||
|
||||
**Impact:** Dashboard Analytics would fail to find pricing for the Haiku tier model, causing incorrect cost calculations.
|
||||
|
||||
**Fix:** Changed `MiniMax-M2.1-Lightning` to `MiniMax-M2.1-lightning` in settings file.
|
||||
|
||||
---
|
||||
|
||||
### 2. ✅ FIXED: Missing MiniMax Placeholder
|
||||
|
||||
**File:** `src/utils/api-key-validator.ts:19-26`
|
||||
|
||||
**Problem:** `DEFAULT_PLACEHOLDERS` did not include `YOUR_MINIMAX_API_KEY_HERE` even though:
|
||||
- It's the placeholder used in `base-minimax.settings.json`
|
||||
- Other providers have their specific placeholders
|
||||
|
||||
**Current behavior:** The generic `YOUR_API_KEY_HERE` catches it, but inconsistent.
|
||||
|
||||
**Fix:** Added `YOUR_MINIMAX_API_KEY_HERE` to `DEFAULT_PLACEHOLDERS` array.
|
||||
|
||||
---
|
||||
|
||||
### 3. Code Duplication with GLM Validator (LOW - Technical Debt)
|
||||
|
||||
**File:** `src/utils/api-key-validator.ts`
|
||||
|
||||
**Problem:** `validateMiniMaxKey` (~95 lines) is nearly identical to `validateGlmKey` (~95 lines). Only differences:
|
||||
- Default base URL
|
||||
- Error message content
|
||||
- Suggestion message content
|
||||
|
||||
**Impact:** Future maintenance requires updating both functions. Risk of divergence.
|
||||
|
||||
**Future Fix (optional):** Extract a common helper function:
|
||||
```typescript
|
||||
async function validateApiKeyCommon(
|
||||
apiKey: string,
|
||||
providerName: string,
|
||||
defaultBaseUrl: string,
|
||||
errorMessages: { rejected: string; suggestion: string }
|
||||
): Promise<ValidationResult>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What's Working Well
|
||||
|
||||
| Aspect | Status |
|
||||
|--------|--------|
|
||||
| Follows GLM pattern | OK |
|
||||
| Fail-open design on network errors | OK |
|
||||
| Settings template format | OK |
|
||||
| Model pricing entries | OK |
|
||||
| Provider presets sync (UI + API) | OK |
|
||||
| Placeholder detection | OK |
|
||||
| Skip pre-flight via env var | OK |
|
||||
|
||||
---
|
||||
|
||||
## Required Changes (Before Merge)
|
||||
|
||||
1. **Fix Issue 1:** Change `MiniMax-M2.1-Lightning` to `MiniMax-M2.1-lightning` in settings
|
||||
2. **Fix Issue 2:** Add `YOUR_MINIMAX_API_KEY_HERE` to `DEFAULT_PLACEHOLDERS`
|
||||
|
||||
---
|
||||
|
||||
## Optional Changes (Technical Debt)
|
||||
|
||||
3. Consider refactoring validators to share common code (Issue 3)
|
||||
|
||||
---
|
||||
|
||||
## Verification Commands
|
||||
|
||||
```bash
|
||||
# After fixes, run validation
|
||||
bun run validate
|
||||
|
||||
# Check settings file
|
||||
cat config/base-minimax.settings.json
|
||||
|
||||
# Verify pricing lookup works (manually test if needed)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Review Summary
|
||||
|
||||
| Issue | Severity | Type | Status |
|
||||
|-------|----------|------|--------|
|
||||
| Model name case mismatch | Medium | Bug | ✅ FIXED |
|
||||
| Missing MiniMax placeholder | Low | Inconsistency | ✅ FIXED |
|
||||
| Code duplication with GLM | Low | Tech debt | Optional |
|
||||
|
||||
**Status:** All required issues (1 & 2) resolved. Ready for merge.
|
||||
@@ -99,11 +99,11 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
category: 'alternative',
|
||||
},
|
||||
{
|
||||
id: 'minimax',
|
||||
id: 'mm',
|
||||
name: 'Minimax',
|
||||
description: 'M2.1/M2.1-lightning/M2 - multilang coding (1M context)',
|
||||
baseUrl: 'https://api.minimax.io/anthropic',
|
||||
defaultProfileName: 'minimax',
|
||||
defaultProfileName: 'mm',
|
||||
defaultModel: 'MiniMax-M2.1',
|
||||
apiKeyPlaceholder: 'YOUR_MINIMAX_API_KEY',
|
||||
apiKeyHint: 'Get your API key at platform.minimax.io',
|
||||
|
||||
+2
-2
@@ -561,7 +561,7 @@ async function main(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
if (profileInfo.name === 'minimax') {
|
||||
if (profileInfo.name === 'mm') {
|
||||
const preflightSettingsPath = getSettingsPath(profileInfo.name);
|
||||
const preflightSettings = loadSettings(preflightSettingsPath);
|
||||
const apiKey = preflightSettings.env?.['ANTHROPIC_AUTH_TOKEN'];
|
||||
@@ -580,7 +580,7 @@ async function main(): Promise<void> {
|
||||
console.error(validation.suggestion);
|
||||
}
|
||||
console.error('');
|
||||
console.error(info('To skip validation: CCS_SKIP_PREFLIGHT=1 ccs minimax "prompt"'));
|
||||
console.error(info('To skip validation: CCS_SKIP_PREFLIGHT=1 ccs mm "prompt"'));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export async function validateMiniMaxKey(
|
||||
valid: false,
|
||||
error: 'API key not configured',
|
||||
suggestion:
|
||||
'Set ANTHROPIC_AUTH_TOKEN in ~/.ccs/minimax.settings.json\n' +
|
||||
'Set ANTHROPIC_AUTH_TOKEN in ~/.ccs/mm.settings.json\n' +
|
||||
'Or run: ccs config -> API Profiles -> MiniMax',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -98,11 +98,11 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
category: 'alternative',
|
||||
},
|
||||
{
|
||||
id: 'minimax',
|
||||
id: 'mm',
|
||||
name: 'Minimax',
|
||||
description: 'M2.1/M2.1-lightning/M2 - multilang coding (1M context)',
|
||||
baseUrl: 'https://api.minimax.io/anthropic',
|
||||
defaultProfileName: 'minimax',
|
||||
defaultProfileName: 'mm',
|
||||
badge: '1M context',
|
||||
defaultModel: 'MiniMax-M2.1',
|
||||
requiresApiKey: true,
|
||||
|
||||
Reference in New Issue
Block a user