Skip to content

fix: BYOK#150

Open
kah-seng wants to merge 4 commits intostagingfrom
feat/byok
Open

fix: BYOK#150
kah-seng wants to merge 4 commits intostagingfrom
feat/byok

Conversation

@kah-seng
Copy link
Copy Markdown
Member

@kah-seng kah-seng commented Apr 6, 2026

Key changes:

  • Select models by ID instead of slug so users can have multiple API keys for the same slug
  • Add loading spinner for save/edit actions

@kah-seng kah-seng requested a review from 4ndrelim April 6, 2026 07:14
@kah-seng kah-seng self-assigned this Apr 6, 2026
@kah-seng kah-seng added the bug Something isn't working label Apr 6, 2026
Copilot AI review requested due to automatic review settings April 6, 2026 07:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates BYOK (custom model) handling so model selection can be disambiguated by a unique custom model ID (instead of slug), and adds a saving/loading UX to the API key settings editor.

Changes:

  • Add id + custom_model_id to the chat v2 API (proto + generated clients) and thread customModelId through the webapp stream request builder.
  • Update model picker wiring to support selecting custom models by ID (while still displaying slug).
  • Add an isSaving state to the BYOK settings UI to disable inputs and show a spinner during save/edit.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
webapp/_webapp/src/views/settings/sections/api-key-settings.tsx Adds isSaving state and disables inputs/buttons + spinner during save/edit.
webapp/_webapp/src/views/chat/footer/toolbar/selection.tsx Extends SelectionItem to optionally carry id/isCustom.
webapp/_webapp/src/views/chat/footer/toolbar/model-selection.tsx Passes custom model id/isCustom into selection items and selects custom models by ID.
webapp/_webapp/src/utils/stream-request-builder.ts Adds customModelId into the stream request payload.
webapp/_webapp/src/stores/setting-store.ts Initializes default settings to include customModels: [].
webapp/_webapp/src/stores/conversation/conversation-ui-store.ts Persists lastUsedCustomModelId in UI state.
webapp/_webapp/src/hooks/useSendMessageStream.ts Threads lastUsedCustomModelId into stream requests.
webapp/_webapp/src/hooks/useLanguageModels.ts Maps SupportedModel.id into UI models and prefers selecting custom models by ID.
proto/chat/v2/chat.proto Adds SupportedModel.id and CreateConversationMessageStreamRequest.custom_model_id.
pkg/gen/api/chat/v2/chat.pb.go Regenerates Go protobuf types for the new fields.
webapp/_webapp/src/pkg/gen/apiclient/chat/v2/chat_pb.ts Regenerates TS protobuf types for the new fields.
internal/api/chat/list_supported_models_v2.go Populates SupportedModel.id for custom models.
internal/api/chat/create_conversation_message_stream_v2.go Resolves custom models by custom_model_id instead of slug.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants