Repository navigation
feat(app): choose OpenRouter or TypeSafe for Jev in the API keys dialog - #152
Open
tbrandenburg wants to merge 2 commits into
Open
tbrandenburg wants to merge 2 commits into
tbrandenburg wants to merge 2 commits into
Conversation
added 2 commits
November 22, 2026 14:22
…server keys JEV_PROVIDER=openrouter selects OpenRouter's Decisions API with OPENROUTER_API_KEY and typesafe/jev-1.14 by default. TypeSafe remains the default; visitor keys always use TypeSafe; an unsupported value fails at startup with no fallback. Closes CopilotKit#147
The dialog gets a Jev provider selector. The choice travels in x-jev-provider next to the key headers, is allow-listed by the Next.js proxy and the agent middleware, is stripped before the inner app, namespaces BYOK thread IDs, and selects the validation endpoint. Omitting the header keeps TypeSafe behavior. Closes CopilotKit#148
This branch has not been deployed
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.
Summary
Lets visitors who bring their own keys choose OpenRouter or TypeSafe for Jev in the API keys dialog. Omitting the choice keeps today's TypeSafe behaviour.
Closes #148
Stacked on #151 (shared-server provider support, closes #147): this branch contains that PR's commit, so review only the top commit,
feat(app): choose OpenRouter or TypeSafe for Jev in the API keys dialog. I'll rebase once #151 merges.Changes
x-jev-provideris only sent when OpenRouter is chosen.apps/app/src/lib/provider-keys.ts: strict allow-list for the header (typesafe|openrouter); anything else is rejected with the existing input error.credentials.py:Credentials.jev_provider,x-jev-provideris stripped like the other credential headers, an unknown value isinvalid_keys, and the provider is part of the BYOK thread-ID hash so checkpoints never mix providers./credentials/validatenow tests the selected provider's endpoint.visualization_router.jev_provider()uses the visitor's provider when credentials are present.Security notes
Same handling as the existing key headers: memory-only in the browser, not persisted or logged, stripped before the inner app, tracing disabled for BYOK. Unknown provider values fail closed. Changing the provider changes the thread namespace, so no history is shared across providers.
Testing
uv run --directory apps/agent pytest: 119 passed (new: header parsing and allow-list, provider-specific thread namespacing, visitor provider overriding the server setting).pnpm --filter @repo/app test: 165 passed (new: header allow-list).pnpm --filter @repo/app lint: no errors.POST /credentials/validatereturning 200.Not verified
applyPatchlog noise from bug: AG-UI delta patches fail with "a.applyPatch is not a function" (@ag-ui/client 0.0.52) #146 is still present when running it.