fix(ai-gateway): fix providers dropdown, prompt test, model selector, compare panel#3578
Draft
gorkem-bwl wants to merge 6 commits intodevelopfrom
Draft
fix(ai-gateway): fix providers dropdown, prompt test, model selector, compare panel#3578gorkem-bwl wants to merge 6 commits intodevelopfrom
gorkem-bwl wants to merge 6 commits intodevelopfrom
Conversation
…rings
The /providers endpoint returned model names as plain strings but the
frontend useGatewayModels() hook expects objects with { id, mode }.
The mode filter (chat/completion) rejected all models because
string.mode is undefined, resulting in empty provider/model dropdowns
in the endpoint creation form.
Now returns { id: model_name, mode: info.mode } for each model.
…oint
## Changes
- Implement /prompts/test endpoint: resolves variables, streams LLM
response via SSE (was a 501 stub). Uses the same stream_chat_completion
service as the tenant chat. Frontend's streamPromptTest() reader works
with this format.
- Fix /providers endpoint: return model objects { id, mode } instead of
plain strings. The frontend useGatewayModels() hook filters by mode
(chat/completion) which rejected all models when mode was undefined.
Fixes empty Provider and Model dropdowns in endpoint creation form.
…reshold The model dropdown had 2,500+ items from all providers. Replaced the Select component with a searchable Field that shows a filtered dropdown only after typing 2+ characters. Shows max 20 results, highlights current selection. Prevents the browser from freezing on render.
The endpoint selector and variable inputs were inside the Chat tab only. Test set and Compare tabs couldn't see which endpoint was selected, making Run All silently fail. Moved the selector above all tabs so it's shared across Chat, Compare, and Test set.
streamPromptTest used fetch() with absolute URL (localhost:3000) from localhost:5173, triggering CORS preflight that blocked the actual POST. Changed to relative /api/... URL which goes through Vite's dev proxy, avoiding CORS entirely. This is the same approach axios uses.
…n/endpoint dropdowns were not selectable
gorkem-bwl
added a commit
that referenced
this pull request
Apr 1, 2026
## Changes - Replace 501 stub in /prompts/test with real SSE streaming via resolve_endpoint_for_key + stream_chat_completion - Fix CORS: use relative URL (/api/ai-gateway/prompts/test) instead of absolute GATEWAY_API_URL for the prompt test fetch - Add getOptionValue to Compare panel version and endpoint Select dropdowns so they are actually selectable ## Context Reimplements the key fixes from PR #3578 on a clean branch from develop, avoiding the 292-file diff from the stale base branch.
3 tasks
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
{ id, mode }objectsgetOptionValueTest plan