Skip to content

feat(provider): add Straitly - #2575

Merged
zerob13 merged 2 commits into
ThinkInAIXYZ:devfrom
HashimSyedUBC:feat/add-straitly-provider
Nov 28, 2026
Merged

zerob13 merged 2 commits into
ThinkInAIXYZ:devfrom
HashimSyedUBC:feat/add-straitly-provider

Conversation

@HashimSyedUBC

@HashimSyedUBC HashimSyedUBC commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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/models catalog is public and responds without authentication, the provider definition uses checkStrategy: 'generate-text' with checkModelId: 'claude-haiku-5-5' (matching the trustedrouter and standardcompute pattern) so connection checks validate the API key rather than accepting an invalid key.

Changes

  • src/main/provider/defaults.ts: register straitly (enable: false, apiType: 'openai-completions', baseUrl: 'https://api.straitly.ai/v1', official/API key/docs/models URLs)
  • src/main/provider/providerRegistry.ts: register straitly with checkStrategy: 'generate-text', credentialStrategy: 'api-key', embeddingStrategy: 'none', and checkModelId: 'claude-haiku-5-5'
  • src/renderer/src/assets/llm-icons/straitly.svg and src/renderer/src/components/icons/modelIconRegistry.ts: add monochrome currentColor provider icon and register it in modelIcons and monoIconUrls
  • README.md, README.zh.md, README.jp.md: list Straitly in the supported providers table
  • test/main/provider/defaultProviders.test.ts and test/main/provider/basicApiKeyProviders.test.ts: add unit tests covering default config, provider definition, and OpenAI-compatible model discovery

Verification

  • npx vitest run test/main/provider --maxWorkers=2: 62 test files passed (758 tests, including providerRuntime.test.ts native generate-text check)
  • pnpm run lint, pnpm run icons:check, pnpm run architecture:renderer-baseline:check, oxfmt --check, pnpm run typecheck:node, pnpm run typecheck:web: all passed
  • Live-tested against https://api.straitly.ai/v1:
    • GET /v1/models: HTTP 200 (176 models, including claude-haiku-5-5, claude-sonnet-5-5, and deepseek/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-5 and deepseek/deepseek-v4-1-flash-1017): HTTP 200 (finish_reason: "stop")
    • Invalid API key on POST /v1/chat/completions: HTTP 401 (Invalid API key.)

Summary by CodeRabbit

  • New Features
    • Added Straitly as a model provider, with its website and icon displayed in the provider list.
    • Added Straitly model discovery and API-key credential checks. The provider is disabled by default and can be configured with an API key.
  • Documentation
    • Updated the English, Japanese, and Chinese README files with Straitly provider information and a link to its website.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds Straitly as a disabled OpenAI-compatible provider with API-key authentication and model discovery. It registers Straitly’s model icon and adds the provider to the English, Japanese, and Chinese README listings.

Changes: Straitly provider support

Layer / File(s) Summary
Provider registration and validation
src/main/provider/defaults.ts, src/main/provider/providerRegistry.ts, test/main/provider/defaultProviders.test.ts, test/main/provider/basicApiKeyProviders.test.ts
Adds Straitly’s disabled provider configuration and OpenAI-compatible registry settings. Tests cover the configuration, API-key credential check, and authenticated model discovery.
Provider icon and README listings
src/renderer/src/components/icons/modelIconRegistry.ts, README.md, README.jp.md, README.zh.md
Registers the Straitly model icon and adds Straitly to the supported provider lists in the three README files.

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

Change: Feature

Suggested reviewers: zerob13

Merge Risk: Minimal · up to a9aef · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "feat(provider): add Straitly" states the main change: a new Straitly provider is added. The changeset adds Straitly as a disabled built-in OpenAI-compatible provider, with its defaults, reg…
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: Title check

Explanation

The title "feat(provider): add Straitly" states the main change: a new Straitly provider is added. The changeset adds Straitly as a disabled built-in OpenAI-compatible provider, with its defaults, registry entry, icon, README listings, and tests. The title is short, specific, and matches the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7970eef-a43c-4743-81e1-242164ee0bf1
Commits

Reviewing files that changed from the base of the PR and between 46e69f9 and a9aef46.

Files selected for processing: 3

  • README.jp.md
  • README.md
  • README.zh.md
Files with no reviewable changes: 3

  • README.jp.md
  • README.md
  • README.zh.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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/models returns 200 without credentials, so fetch-models would accept an invalid key; generate-text with claude-haiku-5-5 is the correct check strategy. That model id exists in the live catalog, /v1/chat/completions returns 401 without a key, and /v1/embeddings returns 404, so embeddingStrategy: 'none' is correct.
  • The definition matches existing aggregators (trustedrouter, standardcompute, teamoRouter): openai-completions, empty key, enable: false. No alias in providerId.ts is needed, and resources/model-db/providers.json is a generated build-time snapshot, so no manual row is expected.
  • The icon follows the repo's mono icon pattern (1em size, currentColor, registered in monoIconUrls) and has no scripts or external references.
  • Tests are in the conventional files, use the existing DEFAULT_PROVIDERS / AiSdkProvider pattern, and restore global.fetch.

Non-blocking

  1. test/main/provider/basicApiKeyProviders.test.ts:921 repeats generic fetchModels coverage 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.
  2. The website URLs omit ?utm_source=deepchat, while most recent provider entries include it. Only matters if referral attribution is wanted.
  3. claude-haiku-5-5 is 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 other generate-text provider, 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 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 the generate-text connectivity check uses a real model.
  • /app/keys, /docs/quickstart, and /models all resolve. The icon uses currentColor and 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; commit a9aef468 touches only the three README files.
  • git merge-tree a9aef468 origin/dev exits 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-5 present; all four websites URLs → 200; /dashboard/keys → 404.

@zerob13
zerob13 merged commit 7719c98 into ThinkInAIXYZ:dev Nov 28, 2026
12 checks passed
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.

2 participants