[codex] Add Modelsell provider - #2043
Conversation
📝 WalkthroughWalkthroughAdds Modelsell as a disabled OpenAI-compatible provider preset, validates ChangesModelsell provider integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 `@test/main/provider/basicApiKeyProviders.test.ts`:
- Around line 170-177: Update the AiSdkProvider construction in the basic API
key provider test to pass the required third ProviderLocalePort argument,
reusing the existing locale fixture or a suitable mock. Preserve the current
provider and settings arguments while ensuring the constructor never receives
undefined for its locale dependency.
🪄 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 Plus
Run ID: 22251ea9-1e86-46a6-8142-4e1b7fe57847
⛔ Files ignored due to path filters (1)
src/renderer/src/assets/llm-icons/modelsell.pngis excluded by!**/*.png
📒 Files selected for processing (5)
src/main/provider/defaults.tssrc/renderer/src/components/icons/modelIconRegistry.tstest/main/provider/basicApiKeyProviders.test.tstest/main/provider/defaultProviders.test.tstest/renderer/components/ModelIcon.test.ts
| const provider = new AiSdkProvider( | ||
| createProvider({ | ||
| id: 'modelsell', | ||
| name: 'Modelsell', | ||
| baseUrl: 'https://modelsell.com/v1' | ||
| }), | ||
| createProviderSettings() | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Pass the required locale dependency to AiSdkProvider.
Line [170] constructs AiSdkProvider with only two arguments, but its constructor requires a third ProviderLocalePort argument. Add the existing locale fixture or a suitable mock as the third argument; otherwise type checking should fail and runtime initialization may receive undefined.
This cross-file finding relies on the constructor contract in src/main/provider/providers/aiSdkProvider.ts.
🤖 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/main/provider/basicApiKeyProviders.test.ts` around lines 170 - 177,
Update the AiSdkProvider construction in the basic API key provider test to pass
the required third ProviderLocalePort argument, reusing the existing locale
fixture or a suitable mock. Preserve the current provider and settings arguments
while ensuring the constructor never receives undefined for its locale
dependency.
Registers OrcaRouter as a disabled built-in OpenAI-compatible provider, mirroring the Modelsell registration (#2043): a DEFAULT_PROVIDERS entry, the model icon, and a provider-import mapping so configs pointing at api.orcarouter.ai land on the built-in provider instead of a custom one. Models are discovered live from /v1/models, so no provider-db entry is needed.
Summary
https://modelsell.com/v1and discover models dynamically from/v1/modelsCloses #2042
Implementation
modelsellopenai-completions/ OpenAI-compatible runtimeGET /v1/modelsprovider/installflow; no Modelsell-specific routeThe integration does not hardcode a model catalog or introduce provider-specific request behavior.
Validation
pnpm run formatpnpm run format:checkpnpm run i18npnpm run lintpnpm run typecheckpnpm run icons:checkpnpm exec vitest run --config vitest.config.ts test/main/provider/defaultProviders.test.ts test/main/provider/basicApiKeyProviders.test.ts(19 tests passed)pnpm exec vitest run --config vitest.config.renderer.ts test/renderer/components/ModelIcon.test.ts(6 tests passed)No live authenticated Modelsell API call was performed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests