Repository navigation
feat(provider): add Straitly - #2575
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
zerob13
left a comment
There was a problem hiding this comment.
Reviewed head 46e69f9d. Approve — no blocking issues.
What this changes: Adds Straitly as a disabled built-in OpenAI-compatible provider (https://api.straitly.ai/v1): a defaults entry, a registry definition, an icon, README rows, and two tests.
Checks
- The metadata is real, not placeholder data.
GET https://api.straitly.ai/v1/modelsreturns 200 without credentials, sofetch-modelswould accept an invalid key;generate-textwithclaude-haiku-5-5is the correct check strategy. That model id exists in the live catalog,/v1/chat/completionsreturns 401 without a key, and/v1/embeddingsreturns 404, soembeddingStrategy: 'none'is correct. - The definition matches existing aggregators (
trustedrouter,standardcompute,teamoRouter):openai-completions, empty key,enable: false. No alias inproviderId.tsis needed, andresources/model-db/providers.jsonis a generated build-time snapshot, so no manual row is expected. - The icon follows the repo's mono icon pattern (
1emsize,currentColor, registered inmonoIconUrls) and has no scripts or external references. - Tests are in the conventional files, use the existing
DEFAULT_PROVIDERS/AiSdkProviderpattern, and restoreglobal.fetch.
Non-blocking
test/main/provider/basicApiKeyProviders.test.ts:921repeats genericfetchModelscoverage that CloudGPU and Obscurify already exercise. Also,expect(defaults).toBeDefined()at line 923 can never fail after the non-null assertion on line 922. The TeamoRouter precedent only asserts the resolved definition, so dropping the fetch block would be enough.- The website URLs omit
?utm_source=deepchat, while most recent provider entries include it. Only matters if referral attribution is wanted. claude-haiku-5-5is a pinned check model. If Straitly retires or renames it, connection checks fail until the constant is updated. This is the same exposure as every othergenerate-textprovider, so no action is required now.
Verification: static review plus read-only requests to the public Straitly endpoints. I could not execute Vitest locally because the review worktree has no node_modules. CI is running.
zerob13
left a comment
There was a problem hiding this comment.
Rapid-MLX landed in #2578. Git now reports conflicts in the provider tables in README.md, README.zh.md, and README.jp.md. I checked a merge against dev at 267a34f25. The provider registration, icon registry, and tests merge cleanly.
Please sync this branch with dev and keep both Straitly and Rapid-MLX in each table. The implementation at 46e69f9d still has my approval. Once the conflict is resolved and CI passes on the updated branch, this can merge.
zerob13
left a comment
There was a problem hiding this comment.
Re-reviewed head a9aef468. Approve — the delta is docs-only and clears the README conflict.
What changed since the last review: one commit, docs(provider): align Straitly table entries. It removes the extra row break in README.md, README.zh.md, and README.jp.md, so Straitly now sits next to TeamoRouter instead of starting a new row. A test merge against dev is clean.
Provider code is unchanged since the approved head 46e69f9d, and that head had all required checks green. Quick re-checks on the new head still hold:
- The public model catalog returns 173 models including
claude-haiku-5-5, so thegenerate-textconnectivity check uses a real model. /app/keys,/docs/quickstart, and/modelsall resolve. The icon usescurrentColorand is registered as a mono icon, so it stays visible in dark mode.
One nit, not blocking: the PR description links https://straitly.ai/dashboard/keys, which returns 404. The working console path is /app/keys, which the code already uses.
CI on the new head is still running.
Details
- Head:
a9aef468fc663a7343f931be91cc4067f16c0d17 - Prior review: approved at
46e69f9d; commita9aef468touches only the three README files. git merge-tree a9aef468 origin/devexits clean; conflicts previously reported in the README provider tables are resolved.- Live checks:
GET https://api.straitly.ai/v1/models→ 200, 173 entries,claude-haiku-5-5present; all fourwebsitesURLs → 200;/dashboard/keys→ 404.
Summary
Add Straitly as a disabled built-in OpenAI-compatible provider in DeepChat (
https://api.straitly.ai/v1), giving users access to 100+ models including Claude, GPT, Gemini, Grok and DeepSeek with one API key.Because Straitly's
/v1/modelscatalog is public and responds without authentication, the provider definition usescheckStrategy: 'generate-text'withcheckModelId: 'claude-haiku-5-5'(matching thetrustedrouterandstandardcomputepattern) so connection checks validate the API key rather than accepting an invalid key.Changes
src/main/provider/defaults.ts: registerstraitly(enable: false,apiType: 'openai-completions',baseUrl: 'https://api.straitly.ai/v1', official/API key/docs/models URLs)src/main/provider/providerRegistry.ts: registerstraitlywithcheckStrategy: 'generate-text',credentialStrategy: 'api-key',embeddingStrategy: 'none', andcheckModelId: 'claude-haiku-5-5'src/renderer/src/assets/llm-icons/straitly.svgandsrc/renderer/src/components/icons/modelIconRegistry.ts: add monochromecurrentColorprovider icon and register it inmodelIconsandmonoIconUrlsREADME.md,README.zh.md,README.jp.md: list Straitly in the supported providers tabletest/main/provider/defaultProviders.test.tsandtest/main/provider/basicApiKeyProviders.test.ts: add unit tests covering default config, provider definition, and OpenAI-compatible model discoveryVerification
npx vitest run test/main/provider --maxWorkers=2: 62 test files passed (758 tests, includingproviderRuntime.test.tsnativegenerate-textcheck)pnpm run lint,pnpm run icons:check,pnpm run architecture:renderer-baseline:check,oxfmt --check,pnpm run typecheck:node,pnpm run typecheck:web: all passedhttps://api.straitly.ai/v1:GET /v1/models: HTTP 200 (176 models, includingclaude-haiku-5-5,claude-sonnet-5-5, anddeepseek/deepseek-v4-1-flash-1017)POST /v1/chat/completions(claude-haiku-5-5,max_tokens: 16,temperature: 0.2,"Hello"): HTTP 200 (finish_reason: "stop")POST /v1/chat/completions(claude-sonnet-5-5anddeepseek/deepseek-v4-1-flash-1017): HTTP 200 (finish_reason: "stop")POST /v1/chat/completions: HTTP 401 (Invalid API key.)Summary by CodeRabbit