feat(ai): add OpenRouter session routing and Responses transport - #818
Open
paralin wants to merge 1 commit into
Open
feat(ai): add OpenRouter session routing and Responses transport#818paralin wants to merge 1 commit into
paralin wants to merge 1 commit into
Conversation
Signed-off-by: Christian Stewart <christian@aperture.us>
paralin
force-pushed
the
feat/openrouter-responses-transport
branch
from
August 12, 2026 22:27
076a522 to
f70cd58
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Send Prime’s opaque session identifier as OpenRouter’s
session_idso Chat Completions requests from one session share dashboard grouping and sticky upstream routing.Add a default-off
openRouter.responsessetting that selects OpenRouter’s stateless Responses transport on each provider request. The Responses path keeps the session ID, prompt cache key, provider routing, tools, and reasoning settings. It falls back to Chat Completions only when the Responses endpoint is unavailable before streaming starts; authentication, rate-limit, context, cancellation, and post-start failures stay on the selected transport.Verified the changed AI provider paths with 17 focused tests and the settings path with 34 focused tests.
npm run checkalso passes, including Biome, TypeScript, installer rendering, and the browser smoke check.Note
Add OpenRouter session routing and Responses transport with Chat Completions fallback
session_idto OpenRouter Chat Completions and Responses requests, populated fromoptions.sessionId, for dashboard grouping and sticky routing.openRouterResponsesoption inSimpleStreamOptionsthat routes OpenRouter requests through the stateless Responses transport instead of Chat Completions.openRouterResponsesis enabled, astreamOpenRouterResponsesWithChatFallbackhelper automatically falls back to Chat Completions if the Responses transport fails before streaming begins (e.g. 404, 405, 501, or unsupported endpoint).getOpenRouterResponses()getter insettings-manager.tsreading fromopenRouter.responses(defaultfalse), wired into the agent session insdk.ts.compat.openRouterRouting.Macroscope summarized f70cd58.