Skip to content

feat(provider): add RunInfra support - #2223

Merged
zerob13 merged 1 commit into
devfrom
codex/add-runinfra-provider
Aug 31, 2026
Merged

feat(provider): add RunInfra support#2223
zerob13 merged 1 commit into
devfrom
codex/add-runinfra-provider

Conversation

@zerob13

@zerob13 zerob13 commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

RunInfra users currently need a custom provider profile. This PR adds a built-in runinfra profile with the official workspace API endpoint and logo.

  • Reuse AiSdkProvider with the OpenAI-compatible Chat Completions transport at https://api.runinfra.ai/v1; no new adapter or dependency.
  • Discover models and check credentials through authenticated GET /v1/models, without generating billable inference. API keys use existing main-process provider storage.
  • Add the static official SVG mark with the existing monochrome light/dark theme handling.
  • Cover default-profile model discovery, Bearer authentication, and invalid-key errors with a focused contract test.

Validation passed:

  • pnpm run format and pnpm run format:check
  • pnpm run i18n
  • pnpm run lint
  • pnpm run typecheck
  • 100 main tests across provider defaults, registration, runtime, factory, reasoning wire, and OpenAI compatibility.
  • 37 renderer tests covering provider settings, API configuration, and model icons.
  • SVG checked at small sizes in light and dark themes.
BEFORE
Provider catalog -> RunInfra unavailable

AFTER
Provider catalog -> [R] RunInfra
                         |
                         v
Provider settings -> API Key [********]  [Refresh models]

API contract: RunInfra quickstart and model discovery.

Summary by CodeRabbit

  • New Features

    • Added RunInfra as a supported AI provider.
    • Added RunInfra model discovery through its models endpoint.
    • Added API key authentication and provider connection validation.
    • Added RunInfra branding and icon support.
  • Tests

    • Added coverage for model discovery, successful authentication, and invalid API key handling.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cc04e005-c3f1-41c7-bb00-499d69ce545b

📥 Commits

Reviewing files that changed from the base of the PR and between 8dada4b and fffbfa0.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/assets/llm-icons/runinfra.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • src/main/provider/defaults.ts
  • src/main/provider/providerRegistry.ts
  • src/renderer/src/components/icons/modelIconRegistry.ts
  • test/main/provider/basicApiKeyProviders.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

RunInfra is added as a disabled OpenAI-compatible provider with API-key authentication and no embedding support. Its model icon is registered. Tests cover model discovery and API-key validation.

Changes

RunInfra provider integration

Layer / File(s) Summary
Register RunInfra provider
src/main/provider/defaults.ts, src/main/provider/providerRegistry.ts, src/renderer/src/components/icons/modelIconRegistry.ts
Adds RunInfra defaults, provider registry settings, and monochrome model icon resolution.
Validate RunInfra API behavior
test/main/provider/basicApiKeyProviders.test.ts
Tests provider resolution, model discovery, valid API keys, invalid API keys, and SDK call behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fffbf

This PR adds a localized built-in RunInfra provider profile, model discovery, authentication handling, and themed branding with validation in place. No actionable merge-blocking risk remains.

Sequence Diagram(s)

sequenceDiagram
  participant ProviderTest
  participant ProviderRegistry
  participant RunInfraAPI
  ProviderTest->>ProviderRegistry: resolve runinfra
  ProviderTest->>RunInfraAPI: request /v1/models with API key
  RunInfraAPI-->>ProviderTest: return models or 401
  ProviderTest->>ProviderRegistry: check API key result
Loading

Suggested reviewers: cuihuan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding RunInfra provider support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4 files.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-runinfra-provider

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.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review verdict: APPROVED (comment — self-PR cannot be formally approved)

Reviewed head fffbfa01a14dc581751498e22a6d634fbc8756ff (5 files, +87/−0, merge-base diff vs dev).

Checks

  • Pattern conformance: exact template used by recently merged provider additions (e.g. #2215 Synthorai) — defaults.ts entry (disabled built-in, openai-completions, baseUrl + websites metadata), providerRegistry.ts id-mapping (OPENAI_BASE + credentialStrategy: 'api-key', embeddingStrategy: 'none', consistent with 31 other no-embedding entries), icon asset + modelIconRegistry color/mono registration.
  • RunInfra is already present in resources/model-db/providers.json (auto-refreshed catalog), so the built-in defaults entry and the public model DB now align — no schema drift.
  • Tests: appropriate, not excessive — one focused test covering model discovery via the OpenAI-compatible endpoint, fetchModels result shape, check() success + 401 error path, and Authorization: Bearer header. Mirrors the existing per-provider test granularity.
  • Verification on PR branch: basicApiKeyProviders.test.ts 21/21 passed; oxfmt --check and pnpm lint clean. typecheck failures are the pre-existing markstream-vue/markdownWorkerLifecycle.ts renderer errors on current dev, unrelated to this PR.
  • No over-engineering, no breaking changes, no UI-visible behavior change (provider stays enable: false until user opts in).

Nothing to change. Ship it.

@zerob13
zerob13 merged commit 04451d7 into dev Aug 31, 2026
12 checks passed
@zhangmo8
zhangmo8 deleted the codex/add-runinfra-provider branch September 1, 2026 04:59
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