feat: add Novita AI provider
Summary
Add Novita AI as a provider using the existing OpenAI-compatible provider path.
Changes
- Add Novita AI to the built-in cloud provider chips
- Configure the Novita endpoint as https://api.novita.ai/openai with bearer auth
- Prefill Novita routing with deepseek/deepseek-v4-pro
- Add AIPanel coverage for Novita connection and routing defaults
Verification
- pnpm --dir app exec vitest run --config test/vitest.config.ts src/components/settings/panels/tests/AIPanel.test.tsx
- pnpm --dir app exec tsc --noEmit
- git diff --check
Summary by CodeRabbit
- New Features
- Added Novita as a built-in AI provider with a default endpoint, default model preselection, and Novita-specific API key placeholder.
- Novita integrated into provider selection lists, provider connect flow, per-workload custom routing, and model placeholder behavior when switching providers.
- Tests
- Added integration tests covering Novita connection, API-key flow, and routing/model defaults.
Adds Novita as a built-in cloud provider: provider metadata and endpoint, default model mappings, custom-routing model seeding and placeholders, provider UI/editor wiring for Novita, and tests for connect and routing flows. AI Settings Panel Refactor 🎯 3 (Moderate) | ⏱️ ~20 minutes 🐰 I hopped into settings, bright and spry, ✏️ Tip: You can configure your own custom pre-merge checks in the settings.📝 Walkthrough
Walkthrough
Changes
Layer / File(s)
Summary
Built-in provider metadata (Novita)
app/src/components/settings/panels/AIPanel.tsxAdds
novita to the built-in provider catalog and slug list, registers a default model entry, and maps the default endpoint to https://api.novita.ai/openai/v1.
Provider key dialog, chips, and editor options
app/src/components/settings/panels/AIPanel.tsxRenders provider chips from the expanded built-in slug list (including Novita), adds a Novita-specific API key placeholder in
ProviderKeyDialog, and sources CloudProviderEditor default slug and dropdown options from CLOUD_EDITOR_SLUGS plus the currently selected slug when needed.
CustomRoutingDialog model seeding & placeholders
app/src/components/settings/panels/AIPanel.tsxSeeds
CustomRoutingDialog initial model from BUILTIN_PROVIDER_DEFAULT_MODELS for built-in slugs, updates provider-switch logic to set the mapped default model, and updates the model input placeholder to prefer the built-in default model.
Tests for Novita connect and routing
app/src/components/settings/panels/__tests__/AIPanel.test.tsxAdds tests covering: connecting Novita via the API-key dialog and asserting saved provider shape/call to
setCloudProviderKey, routing a workload to Novita with the prefilled default model, and a Custom-editor default retention scenario.Sequence Diagram
sequenceDiagram
participant User
participant AIPanel
participant ProviderKeyDialog
participant CustomRoutingDialog
participant useAISettings
User->>AIPanel: Toggle "Connect Novita AI" chip
AIPanel->>ProviderKeyDialog: Open (novita-specific placeholder)
User->>ProviderKeyDialog: Enter API key + Save
ProviderKeyDialog->>useAISettings: setCloudProviderKey('novita', key)
User->>AIPanel: Open CustomRoutingDialog for workload
CustomRoutingDialog->>AIPanel: prefill model from BUILTIN_PROVIDER_DEFAULT_MODELS['novita']
User->>CustomRoutingDialog: Save routing draft
CustomRoutingDialog->>useAISettings: saveAISettings(draft with novita routing)
Estimated code review effort
Suggested labels
featurePoem
I added Novita to the provider sky,
A key, a chip, a model prefilled,
Routing saved and tests fulfilled,
A tiny hop, a curious sigh!🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
⚠️ Warning
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description Check
✅ Passed
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
✅ Passed
The title 'feat: add Novita AI provider' is concise, specific, and accurately describes the main change—adding Novita as a new built-in cloud provider.
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.
✨ Finishing Touches
⚔️ Resolve merge conflicts
pullman-novita-ai-provider
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add
eslintto devDependencies.
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 @coderabbitai help to get the list of available commands and usage tips.
I picked up the current CI failure here. The Coverage Gate is failing because the Novita provider placeholder branch in AIPanel.tsx is uncovered (Novita API key). I opened a helper PR against the source branch with a focused test assertion: https://github.com/Alex-yang00/openhuman/pull/1\n\nValidation on the helper branch:\n- pnpm exec vitest run --config test/vitest.config.ts src/components/settings/panels/tests/AIPanel.test.tsx --reporter=dot\n- pnpm exec prettier --check src/components/settings/panels/tests/AIPanel.test.tsx\n- git diff --check -- app/src/components/settings/panels/tests/AIPanel.test.tsx\n\nThe E2E failures in the current run look unrelated to this Novita change: several clicks are being intercepted by eact-joyride-portal, and this PR is also currently marked dirty against main, so it will still need a branch sync/conflict resolution after the coverage helper lands.