Config: add MiniMax direct API authentication option

Makes apiKey optional in ModelProviderConfig so MiniMax can use auth
profiles or environment variables (MINIMAX_API_KEY) instead of requiring
explicit config.

Changes:
- src/config/types.ts: apiKey changed from required to optional
- src/config/zod-schema.ts: use z.string().min(1).optional() for validation
- src/commands/configure.ts: add minimax-api auth choice in wizard
- src/commands/onboard-auth.ts: MiniMax provider omits apiKey (uses env/auth)
- patches/@mariozechner__pi-ai@0.42.1.patch: map minimax → MINIMAX_API_KEY

Auth Resolution Order (unchanged):
1. Auth profiles (highest priority)
2. Environment variables (MINIMAX_API_KEY, etc.)
3. Custom provider apiKey from models.json (lowest priority)
This commit is contained in:
mneves75
2026-01-10 10:57:09 -03:00
parent 0258c746bc
commit 3e2e3eb023
6 changed files with 69 additions and 3 deletions

View File

@@ -115,3 +115,39 @@ EOF
```
This is a Claude Code quirk, not a clawdbot bug.
---
## PR & Code Review Checklist
Before creating PRs or presenting code for review (especially to senior engineers):
### 1. Verify Code Quality
- [ ] Run `pnpm lint` - no errors
- [ ] Run `pnpm build` - TypeScript compiles
- [ ] Run related tests - all pass
### 2. Review Diff Purity
- [ ] Diff is minimal and focused on the feature
- [ ] No unrelated changes bundled in
- [ ] Patch files: **append** changes, don't replace entire files
### 3. Self-Critique Questions
- Is the auth resolution chain correct?
- Are type changes safe and backwards compatible?
- Would this pass review by John Carmack? (clarity > cleverness)
### 4. Fork Workflow (when applicable)
```bash
# Push to fork
git remote add fork https://github.com/USERNAME/clawdbot
git push fork branch-name
# Create PR from fork
gh pr create --head USERNAME:branch-name --base main
```
### 5. Git Diff Interpretation
- `-` lines = content being **removed**
- `+` lines = content being **added**
- Verify you understand what the diff actually shows