feat(provider): add Straico as a built-in OpenAI-compatible provider#2001
Conversation
Register Straico v2 OpenAI-compatible API as a default provider preset with brand icon, following OpenRouter/Routerra pattern. Disabled by default. Closes ThinkInAIXYZ#959.
📝 WalkthroughWalkthroughAdds Straico as a default OpenAI-compatible provider with API metadata and website links, and registers its model icon for renderer resolution. ChangesStraico integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 `@src/main/provider/defaults.ts`:
- Around line 392-399: Update the Straico runtime URL construction in the
relevant provider runtime logic to preserve the configured /v2 base path and
avoid appending /v1. Ensure chat and model requests use Straico’s documented
/v2/chat and /v2/models routes, while leaving other providers’ URL behavior
unchanged.
🪄 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
Run ID: 2a3e6de1-da5d-46de-b3af-b9de4ab5060f
⛔ Files ignored due to path filters (1)
src/renderer/src/assets/llm-icons/straico.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
src/main/provider/defaults.tssrc/renderer/src/components/icons/modelIconRegistry.ts
| baseUrl: 'https://api.straico.com/v2', | ||
| enable: false, | ||
| websites: { | ||
| official: 'https://www.straico.com/', | ||
| apiKey: 'https://platform.straico.com/settings-api', | ||
| docs: 'https://documenter.getpostman.com/view/5900072/2s9YyzddrR', | ||
| models: 'https://api.straico.com/v2/models', | ||
| defaultBaseUrl: 'https://api.straico.com/v2' |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Preserve Straico’s /v2 base path in runtime URL construction.
src/main/provider/aiSdk/runtime.ts:810-817 appends /v1 to this preset’s baseUrl, which turns https://api.straico.com/v2 into /v2/v1 and breaks chat/model requests. Keep Straico on its documented /v2/chat and /v2/models routes.
🤖 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 `@src/main/provider/defaults.ts` around lines 392 - 399, Update the Straico
runtime URL construction in the relevant provider runtime logic to preserve the
configured /v2 base path and avoid appending /v1. Ensure chat and model requests
use Straico’s documented /v2/chat and /v2/models routes, while leaving other
providers’ URL behavior unchanged.
|
thinks for your contribution |
Summary
Adds Straico as a built-in provider preset (issue #959).
Straico exposes an OpenAI-compatible surface on
https://api.straico.com/v2, so this follows the same path as OpenRouter / Routerra / OpenCode Go:DEFAULT_PROVIDERSentry insrc/main/provider/defaults.ts(apiType: 'openai-completions',enable: false)src/renderer/src/assets/llm-icons/straico.svgmodelIconRegistry.tsScope
Intentionally preset-only for the first landing (chat/completions + models via the existing OpenAI-compatible stack). Native Straico-only surfaces (RAG / Agents / video / TTS) can be separate follow-ups.
Test plan
https://api.straico.com/v2works for chat completionsCloses #959.
Summary by CodeRabbit