feat(providers): add OrcaRouter as built-in cloud provider#2187
Conversation
- Add `orcarouter` to legacy_label_for / legacy_default_endpoint (https://api.orcarouter.ai/v1) so legacy `type=orcarouter` configs migrate cleanly, mirroring the existing OpenRouter handling. - Add `Orcarouter` variant to the legacy CloudProviderType enum (default endpoint, label, wire string; auth_style falls through to Bearer via the existing catch-all). - Whitelist `provider.orcarouter` in the proxy service-key list. - Extend the AI Settings panel: BUILTIN_PROVIDER_META entry, slug options in chip rendering + AddProvider/EditProvider selectors, API-key placeholder, and defaultEndpointFor. - Extend the TS `CloudProviderType` legacy type alias. - Tests: factory builds `orcarouter:<model>` against an `orcarouter` cloud_providers entry; legacy `type=orcarouter` entry seeds the correct slug/label/endpoint/auth_style via migrate_legacy_fields. OrcaRouter is an OpenAI-compatible multi-provider router (Bearer auth, https://api.orcarouter.ai/v1), so it slots straight into the existing `<slug>:<model>` factory grammar — no new transport code required. I am an engineer on the OrcaRouter team.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds OrcaRouter as a built-in cloud provider: backend enum + metadata and legacy mappings, config docs and proxy key, frontend type and AIPanel UI updates (chips, placeholders, defaults, endpoint), and unit tests for parsing and legacy migration. ChangesOrcaRouter Provider Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
graycyrus
left a comment
There was a problem hiding this comment.
Clean, well-structured addition — mirrors the existing OpenRouter pattern exactly. Nice disclosure about team affiliation too.
One minor nit inline, otherwise LGTM.
Addresses graycyrus's review feedback — actual OrcaRouter keys use the sk-orca- prefix, not sk-or-, so the placeholder now matches the real format and is clearly distinct from OpenRouter's sk-or-. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sai#2187) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sai#2187) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sai#2187) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
openai/anthropic/openrouter/customin the AI Settings panel.https://api.orcarouter.ai/v1+Bearerauth as the default endpoint / auth style, mirroring how OpenRouter is handled today.type = "orcarouter"config entries to the new slug-keyed shape (label, endpoint, auth_style) via the existingmigrate_legacy_fieldspath.provider.orcarouterin the proxy service-key list so users can route OrcaRouter calls through a configured proxy.orcarouter:<model>against an OrcaRoutercloud_providersentry; legacytype = orcarouterentry produces the correct slug / label / endpoint / auth_style.Problem
OpenHuman already supports OpenAI-compatible multi-provider routers (e.g. OpenRouter) as first-class chips in the AI Settings panel, but OrcaRouter is not in the built-in list. Today a user has to add it as a
customprovider and re-enter its endpoint each time, which loses the consistency the panel offers for other well-known meta-routers.OrcaRouter is OpenAI-API-compatible (
Authorization: Bearer …athttps://api.orcarouter.ai/v1), so the work needed is purely metadata + UI surfacing — no new transport code, no new auth style.Solution
src/openhuman/config/schema/cloud_providers.rs"orcarouter"tolegacy_label_for(→"OrcaRouter") andlegacy_default_endpoint(→https://api.orcarouter.ai/v1).Orcarouterto the legacyCloudProviderTypeenum and the three smallmatcharms (default_endpoint,label,as_str).auth_style()falls through the existing catch-all toAuthStyle::Bearer.src/openhuman/config/schema/proxy.rs— add"provider.orcarouter"toSUPPORTED_PROXY_SERVICE_KEYS.src/openhuman/config/schema/types.rs— extend the provider-grammar doc-comment.src/openhuman/inference/provider/factory_test.rs— addorcarouter_slug_model(buildsorcarouter:orcarouter/autoagainst a config entry) andorcarouter_legacy_type_seeds_defaults(migration produces correct slug / label / endpoint / auth).app/src/components/settings/panels/AIPanel.tsxorcaroutertoBUILTIN_PROVIDER_META(display label + chip tone).orcarouterin the three slug arrays used for chip rendering, the default-slug picker, and the AddProvider/EditProvider<select>.orcarouter.defaultEndpointFor('orcarouter') → https://api.orcarouter.ai/v1.app/src/utils/tauriCommands/config.ts— extend the legacyCloudProviderTypeunion with'orcarouter'.No changes to provider transport, no new RPC, no protocol changes.
Submission Checklist
factory_test.rs(happy-path slug routing + legacy-config migration).factory_testcases or by the existingAIPanel.test.tsxsuite. Will be confirmed by CI.N/A: behaviour-only addition (one extra built-in slug option in an existing surface).## Related—N/A: see above.N/A: additive built-in option in AI Settings, no release-cut surface change.Closes #NNNin the## Relatedsection —N/A: no linked issue.Impact
cloud_providersis already user-extensible.type = "openrouter"or any other slug are untouched. Users who had previously added OrcaRouter manually ascustomare unaffected (custom entries keep working).auth-profiles.jsonviaAuthService, keyed byprovider:orcarouter, identical to the other slug-keyed entries. No new secret-handling code path.Related
AI Authored PR Metadata
Linear Issue
Commit & Branch
feat/orcarouter-provider75153c38(tip;68b01f6fmain change +75153c38prettier wrap)Validation Run
pnpm typecheck— pass (tsc --noEmit onapp/)pnpm lint— pass (0 errors on changed files; 46 pre-existing warnings in untouched files)prettier --checkon changed files — passAIPanel.test.tsx— 15 / 15 passedcargo check --lib— pass (Rust 1.93.0 MSVC)cargo test factory— 32 / 32 passed, including the two neworcarouter_*casescargo test cloud_providers— 2 / 2 passedcargo fmt --checkon changed files — passValidation Blocked
command:git push(pre-push husky hook)error:Pre-push hook runsprettier --write .(would reformat ~858 unrelated files repo-wide that are already prettier-dirty onmain) andpnpm rust:format(cargo not on the hook's PATH in this shell). Both failures are unrelated to the changes in this PR — the touched files were individually validated withprettier --checkandcargo fmt --checkand are clean.impact:Pushed with--no-verifyperCLAUDE.mdgit-workflow guidance for unrelated hook breakage. Per-file format checks above already confirm the diff itself is clean.Behavior Changes
https://api.orcarouter.ai/v1and Bearer auth.Parity Contract
openai,anthropic,openrouter,custom) unchanged. The catch-all_ => "Custom"/_ => AuthStyle::Bearerbranches remain intact, so any unknown legacy slug still falls back the same way.<slug>:<model>grammar) already dispatches OrcaRouter via the generic Bearer OpenAI-compatible provider — no new dispatch branch added.Duplicate / Superseded PR Handling
Disclosure: I'm an engineer on the OrcaRouter team. OrcaRouter (
https://www.orcarouter.ai) is an OpenAI-API-compatible multi-provider LLM router; this PR only adds it to the built-in slug list and does not embed any router-side source.Summary by CodeRabbit