Skip to content

feat(providers): add OpenRouter aggregator support - #987

Merged
Astro-Han merged 3 commits into
apache:mainfrom
Colafornia:feat/add-openrouter
Jul 14, 2026
Merged

Astro-Han merged 3 commits into
apache:mainfrom
Colafornia:feat/add-openrouter

Conversation

@Colafornia

Copy link
Copy Markdown
Member

Summary

  • add OpenRouter as a ready OpenAI-compatible aggregator provider with models.dev metadata, model discovery, reasoning controls, credentials, and brand assets; refs feat(providers): support common providers from models.dev #860
  • classify OpenRouter under aggregator services and keep its discovered catalog limited to supported models
  • preserve connections for providers unknown to the current build without crashing or deleting saved configuration and credentials
  • label unknown providers as unsupported by the current version instead of incorrectly asking for a key or default model
  • rebind unlocked empty sessions from an unavailable connection to the first configured ready model while leaving locked sessions unchanged

Validation

  • npm run typecheck
  • npm --workspace @maka/core test
  • npm --workspace @maka/storage test
  • npm --workspace @maka/runtime test
  • npm --workspace @maka/desktop test
  • git diff --check

@Colafornia
Colafornia marked this pull request as draft July 14, 2026 15:23
Colafornia and others added 3 commits July 14, 2026 23:29
apache#860 Phase 3)

Mirrors the DeepInfra template: models.dev facts + registry entry, per-model
thinkingOptions, the reasoning_effort wire (off maps to none), headless
credential env, a byte-exact Lobe Icons color mark, and tests across every
workspace. OpenRouter's /api/v1/models response carries no type field, so
model discovery uses the fallback-models filter; the base URL already
includes /api/v1, so the models endpoint is the default \${baseUrl}/models
(no explicit discovery path). Default model is anthropic/claude-sonnet-5.

Co-Authored-By: Claude <[email protected]>
@Colafornia
Colafornia force-pushed the feat/add-openrouter branch from 75205b6 to 2597738 Compare July 14, 2026 15:57
@Colafornia
Colafornia marked this pull request as ready for review July 14, 2026 16:00

@Astro-Han Astro-Han left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving — independently reviewed and cross-checked with a second reviewer. Registry placement mirrors peer aggregators, exact model-id preservation, credential isolation (both turns Bearer-scoped, no cross-provider leakage), the two-stage tool loop, and the brand-asset gate all hold — openrouter.svg is byte-identical to lobe-icons upstream and correctly rendered as a color mark via the COLOR_ASSET_RENDER_CONTRACT <img> seam (not the monochrome mask). Non-blocking follow-ups:

  • [P2] OpenRouter + Anthropic thinking sends top-level reasoning_effort; OpenRouter prefers nested reasoning: { effort } for Anthropic, so effort may silently no-op on the default anthropic/claude-sonnet-5 at thinking tiers (it will not 400). Switching to the nested shape is the higher-value fix.
  • [P3] No reasoning_details replay for Claude-via-OpenRouter (only ZenMux sets replayAssistantReasoningDetails); OpenRouter tolerates absence per its docs (strongly recommended, not required), so this degrades reasoning-continuity quality across tool turns, not correctness.
  • [P3] THIRD_PARTY_LICENSES.txt lists the OpenRouter asset under the @lobehub/[email protected] section header while the code/tests declare 1.92.0; reconcile the version label (the commit SHA and SHA-256 are already correct and consistent).

@Astro-Han
Astro-Han merged commit dfa38be into apache:main Jul 14, 2026
3 checks passed
@Colafornia
Colafornia deleted the feat/add-openrouter branch July 16, 2026 10:20
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