Skip to content

feat: add Novita AI provider#2086

Open
Alex-yang00 wants to merge 2 commits into
tinyhumansai:mainfrom
Alex-yang00:pullman-novita-ai-provider
Open

feat: add Novita AI provider#2086
Alex-yang00 wants to merge 2 commits into
tinyhumansai:mainfrom
Alex-yang00:pullman-novita-ai-provider

Conversation

@Alex-yang00
Copy link
Copy Markdown

@Alex-yang00 Alex-yang00 commented May 18, 2026

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.

Review Change Stack

@Alex-yang00 Alex-yang00 requested a review from a team May 18, 2026 10:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 864dd8e6-6463-4234-8b1d-425214948ed0

📥 Commits

Reviewing files that changed from the base of the PR and between 5159cc0 and 67bc765.

📒 Files selected for processing (2)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/components/settings/panels/__tests__/AIPanel.test.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/components/settings/panels/tests/AIPanel.test.tsx

📝 Walkthrough

Walkthrough

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.

Changes

AI Settings Panel Refactor

Layer / File(s) Summary
Built-in provider metadata (Novita)
app/src/components/settings/panels/AIPanel.tsx
Adds 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.
CustomRoutingDialog model seeding & placeholders
app/src/components/settings/panels/AIPanel.tsx
Seeds CustomRoutingDialog initial model from BUILTIN_PROVIDER_DEFAULT_MODELS and updates provider-switch logic and input placeholder to suggest the built-in default model when a built-in slug is selected.
Provider key dialog, chips, and editor options
app/src/components/settings/panels/AIPanel.tsx
Renders 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 the expanded built-in slug list.
Tests for Novita connect and routing
app/src/components/settings/panels/__tests__/AIPanel.test.tsx
Adds 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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped into settings, bright and spry,
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 accurately captures the main feature addition of integrating Novita AI as a provider in the codebase.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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 eslint to 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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 `@app/src/components/settings/panels/__tests__/AIPanel.test.tsx`:
- Line 1: The test file is empty; add a test suite in AIPanel.test.tsx that
renders the AIPanel component and asserts Novita AI provider connection behavior
and routing defaults: create a describe("AIPanel") block with tests (it/ test)
that use render from `@testing-library/react` and any necessary provider/mocking
utilities (e.g., mock store or MockedProvider) to simulate the Novita AI
provider state, verify that the Novita-related UI elements (labels/buttons) and
connection flow (e.g., connect button triggers expected handler) are present and
behave, and assert routing defaults by checking that default route/link values
or navigation calls occur when no custom route is configured; reference AIPanel
and any handler props like onConnect/onSelectProvider or provider keys such as
"Novita" to locate where to attach mocks and assertions.

In `@app/src/components/settings/panels/AIPanel.tsx`:
- Line 1: Replace the corrupted file content (which currently only contains the
path string) with a full TypeScript React component implementation for AIPanel:
implement and export the AIPanel component (functional React component) that
renders the settings UI, handles form state and validation, and integrates the
Novita AI provider by importing and wiring its provider methods (e.g.,
NovitaProvider, initializeNovitaClient or similar helper names used elsewhere)
so that provider selection, API key/credentials input, test-connection and save
actions work; ensure you include props/state hooks, proper TypeScript types,
event handlers like onSave/onTestConnection, and export default AIPanel so the
settings panel compiles again.
🪄 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

Run ID: f94a1fbc-2c18-4e76-bea2-d69c0bd310cf

📥 Commits

Reviewing files that changed from the base of the PR and between 579addf and 5960a19.

📒 Files selected for processing (2)
  • app/src/components/settings/panels/AIPanel.tsx
  • app/src/components/settings/panels/__tests__/AIPanel.test.tsx

Comment thread app/src/components/settings/panels/__tests__/AIPanel.test.tsx Outdated
Comment thread app/src/components/settings/panels/AIPanel.tsx Outdated
@Alex-yang00 Alex-yang00 force-pushed the pullman-novita-ai-provider branch from 5960a19 to 5159cc0 Compare May 18, 2026 10:16
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant