Repository navigation
Studio: rework Settings > Connections with status, a provider gallery and new connection types - #17753
Conversation
…ry and inline key checks The Connections page was a list with no state and a form that opened with a provider dropdown. A key was only checked on request, the result was a toast, and a connection switched off through the API disappeared from settings. List page - Each connection shows one status line: Connected, Needs API key, Key rejected, No credit, Rate limited, Unreachable, Timed out, Sign in again or Off. Opening the page checks each connection at most once per ten minutes, and the header button shows how old the answers are and re-checks them all. - Each connection has an on/off switch. A switched-off connection stays in the list, dimmed, and is offered in no picker. The backend already refused disabled connections; the UI had no way to set or see the flag. - A provider gallery (Popular, Local and custom, More providers, with search) replaces the dropdown as the way in. An empty list now shows the gallery instead of jumping into a form with ChatGPT preselected. - The models.dev catalog shows its age and can be refreshed on demand. Form - A pasted key is checked as soon as it stops changing. The models it reaches are listed and, for a new connection, the newest ones are ticked. A rejected key is reported under the key field. OpenRouter and Hugging Face keys get a real key check first, since their model list is public. - "Add connection" with nothing ticked lists the models and ticks the suggestions instead of asking for a separate Load click. - "Test connection" checks the form as typed, before saving. - Token limit, extra headers, reasoning and new-model checks fold under Advanced, which opens by itself when one of them is in use. - Model rows show context window, Vision and Reasoning from the catalog, and a Selected filter narrows a long list to what is ticked. - Each provider links to the page where its API key is created. Backend - POST /api/providers/test returns error_kind and says what went wrong for 402, 429 and read timeouts, not only 401/403 and connection failures. - A custom endpoint check reports a named cause from /models instead of asking for a model ID or surfacing the fallback probe's plain 404. - GET /api/providers/registry carries api_key_url. - GET /api/providers/model-catalog?refresh=true refetches inside the daily TTL, at most once a minute. Fixes found on the way - A model list answer that arrived after the form had moved to another connection was written into that connection's form. - The settings page and the sync it starts each fetched the registry; they now share one request. - The show/hide key button drifted off the input when a message rendered below it.
…zure OpenAI, Amazon Bedrock and Vertex AI connections Each is wired from the vendor's API docs. - xAI: filters image, video and voice models from the list, sends max_completion_tokens, omits presence_penalty, and never sends an effort of none because Grok reasoning cannot be turned off. - NVIDIA NIM: filters embedding, guard, OCR and translation models by name, caps temperature at 1 and omits presence_penalty, since its per-model schemas reject unknown fields. - Perplexity: a fixed list of the Sonar models on the bare host, tools off. - Cohere: the compatibility endpoint for chat, the native endpoint for the model list, and reasoning effort mapped onto none and high. - Vercel AI Gateway: lists language models only and checks the key against /credits, because its model list is public. - Azure OpenAI: the resource's /openai/v1 endpoint with typed deployment names, over chat completions. - Amazon Bedrock: the OpenAI-compatible runtime route with a Bedrock API key as a bearer token, so no request signing. Model IDs are typed. - Vertex AI: the native Gemini client pointed at the Vertex host with an API key. It is stored as a Gemini connection and shown as Vertex by its host. Azure, Bedrock, Vertex and Perplexity have no usable model list, so their connection check sends one short chat to the first model instead. The seed model snapshot is regenerated from models.dev to include xAI, NVIDIA and Cohere.
…urns A chat on a cloud connection that outgrew its window used to lose its oldest turns unless the provider compacted server-side (Anthropic direct, OpenAI Responses). Claude through OpenRouter, Vercel AI Gateway or Bedrock, and every other chat-completions provider, went down that path. - Summary compaction: when a request would pass the threshold, Studio asks the same connection and model for a structured summary of the older turns, keeps the recent ones verbatim (up to 15,000 tokens or 30% of the prompt budget) and sends summary plus tail. The summary joins the system prompt, pinned instructions stay verbatim, and the summarized turns are archived so search_conversation still reaches them. A backlog too long for one call is folded in oldest first. - The summary is saved per thread (chat_thread_summaries, keyed by a digest of the turns it covers) and reused on later turns; an edited or branched history does not match and gets its own. The transcript itself is untouched. - If the summary call fails, the old eviction runs, so the chat never fails because of it. - /compact works on a cloud model. OpenAI Responses and Anthropic compact natively for that request (their trigger is lowered to the documented floor); a Claude thread under 60K tokens and every other provider use the summary call. - Connections have an "Auto-compact after" token setting under Advanced, stored with the connection. It replaces the default of 75% of the window and may pass the 200K default cap on Anthropic and OpenAI native compaction up to the model's window. Anthropic's 50K floor stays. Neither vendor documents an upper limit, only a floor (links in external_provider.py). - If a provider refuses a request as too long before any output, Studio compacts once and resends. A second refusal is shown as the error. Off when auto-compact is off. - The context meter shows a cloud model's catalogued window, marks where the chat compacts and names the trigger in its tooltip. The thread says "Earlier messages summarized" or "Older messages dropped" instead of one generic notice, and a progress frame is sent while the summary is written. - A Compact chip appears next to send on a cloud thread over 50,000 tokens that has been idle past the provider's prompt cache lifetime. While it is on, the next message is sent after a summary; a click keeps the full history for that message. Local GGUF, MLX and managed engines are unchanged.
… model list; drop the manual model data refresh
…s, picker fade, one Microsoft logo
It has its own pull request, so this branch carries the Connections work only.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ed rows by chat The chat probe reads the client's error frames, so a refused connection or read timeout came back as a plain failure instead of Unreachable / Timed out. A shared Azure, Bedrock, Perplexity or Vertex row was checked by listing models it does not have; check it with one chat on a model the account may use. The shared failure result gained error_kind.
…a provider switch The SGLang preset fell through to the openai backend type, which sends every turn to /v1/responses with OpenAI's sampling rules and skips the served-window probe. Switching provider during a model load retired the load without clearing its loading flag. [skip ci]
…y are sent as [skip ci]
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # studio/backend/core/inference/provider_model_capabilities.py # studio/frontend/src/features/chat/chat-providers-dialog.tsx
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
The test slices the backfill tail of |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 576b7227a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (configProviderType === "gemini" && isVertexBaseUrl(configBaseUrl)) { | ||
| return "vertex"; |
There was a problem hiding this comment.
Preserve Gemini continuation handling for Vertex connections
When a native Vertex response is stopped during thinking, before producing answer text, Continue cannot resume it: this normalization gives the connection the UI type vertex, but hasGeminiReplayContinuation in api/chat-adapter.ts still requires externalProvider.providerType === "gemini". Consequently, even with captured thought parts/signatures, the adapter throws “This response cannot be resumed” instead of sending the continuation. The same type check also skips Gemini continuation-history expansion. Normalize the alias in these native-Gemini paths, or retain the Gemini runtime identity separately from the gallery label.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 53032c7: one helper says a connection talks to the Gemini API by type (gemini or vertex), and the adapter's thought replay, resume check, continuation turns and thought capture, the composer's image-mode rule and the stop window all use it; tests added.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What changes for the user
Connections page
Connection form
New connection types
Added to the gallery: xAI, NVIDIA NIM, Perplexity, Cohere, Vercel AI Gateway, Azure OpenAI, Amazon Bedrock, Google Vertex AI and SGLang.
None of these was exercised with a real key. They were wired from each service's published API reference.
Backend
POST /api/providers/testreturnserror_kind(auth,billing,rate_limit,not_found,unreachable,timeout,invalid_url,other) and has its own sentence for 402, 429 and read timeouts./modelsinstead of asking for a model ID or surfacing the fallback probe's plain 404.GET /api/providers/registrycarriesapi_key_url.released(the model's release date) when the source has a well-formed one.All of these are additive. An older frontend ignores the new fields; the new frontend falls back when an older backend omits them.
Logos
Fixes found on the way
Behaviour changes worth a look
tests/connections-empty-opens-form.test.tsis rewritten for the new behaviour./modelscall, at most every ten minutes). Connections without a key are skipped.Branch history
The branch contains a commit for cloud summary compaction and a later commit that takes it out again. That work has its own pull request (#17743), so the net diff here is the Connections work only.
Fixes during review
/v1/responses, applied OpenAI's sampling rules and skipped reading the server's window.error_kindfield.temperature,top_porpresence_penalty, which reasoning deployments reject; the deployment name hides the model, as on the custom Azure path.custom,gemini), so Search, Tools, MCP and Docs stay on./endpoints/openapiURL stays on chat completions with Bearer auth, as before this PR; native Vertex URLs use the Gemini API.How it was checked
npm run typecheck,npm test(16286 pass, 0 fail) andnpm run buildinstudio/frontend.pyteston the provider test files instudio/backend/tests(connection checks, model capabilities, new cloud providers): 105 passed.Not checked
Screenshot
An empty Connections page (left: main, right: this PR): the provider gallery replaces the form that opened by itself, with the new connection types listed.