Skip to content

Add TrustedRouter hosted preset (chat) - #582

Open
jperla wants to merge 1 commit into
twinnydotdev:mainfrom
jperla:add-trustedrouter
Open

jperla wants to merge 1 commit into
twinnydotdev:mainfrom
jperla:add-trustedrouter

Conversation

@jperla

@jperla jperla commented Nov 20, 2026

Copy link
Copy Markdown

Summary

Adds TrustedRouter as a hosted chat preset in the provider picker, plus its endpoint defaults and locale blurbs, wired the same way as the DemonRoute preset (#545).

Closes #581.

Changes

  • src/common/constants/providers.ts: registers trustedrouter in OPEN_AI_COMPATIBLE_PROVIDERS and its display name.
  • src/common/provider-validation.ts: chat endpoint defaults api.trustedrouter.com, https, /v1 (chat only, no FIM or embeddings, as in Add DemonRoute hosted preset (chat) #545).
  • src/webview/providers/presets.tsx: hosted preset using the existing codicon("plug") glyph, placed after DemonRoute in the hosted group.
  • src/webview/assets/locales/: preset-trustedrouter blurb added to all 14 locale files, translated.

No version bump or CHANGELOG entry, since those were done at release time for #545; happy to add them if you prefer.

Usage

Pick TrustedRouter under hosted providers and paste an API key from https://trustedrouter.com/console/api-keys. The default model is deepseek/deepseek-v4-flash; any id from GET https://api.trustedrouter.com/v1/models (public, no key) can be used instead, e.g. anthropic/claude-sonnet-4.5, or trustedrouter/auto to let the gateway pick per request. Docs: https://trustedrouter.com/docs.

Verification

Run with HTTP_PROXY=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 NO_PROXY=127.0.0.1,localhost after npm ci:

  • npx tsc -p . --outDir out: exit 0
  • node scripts/build.mjs: exit 0
  • npx eslint src: exit 0
  • npx mocha --ui tdd out/test/suite/provider-validation.test.js: 29 passing
  • npx mocha --ui tdd out/test/suite/provider-discovery.test.js: 13 passing
  • node -e 'const v=require("./out/common/provider-validation.js"); for (const t of ["chat","fim","embedding"]) console.log(t, JSON.stringify(v.getEndpointDefaults("trustedrouter", t)))': chat {"apiHostname":"api.trustedrouter.com","apiProtocol":"https","apiPath":"/v1"}, fim and embedding undefined
  • All 14 locale files parse as JSON.

The full npm test suite (VS Code extension host) was not run here because it downloads VS Code.

Disclosure: I work on TrustedRouter.

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.

Hosted API preset for TrustedRouter (OpenAI-compatible, chat only)

1 participant