feat: Surface organization-enabled custom (BYOK) models#333
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Eclipse client to consume the language server’s new customModel metadata for organization/enterprise-contributed BYOK models so they appear automatically in the chat model picker (including grouping, suffix display, and hover details) without requiring users to configure their own API key.
Changes:
- Extend
CopilotModelprotocol type with acustomModelpayload and incorporate it intoequals/hashCode/toString. - Update model picker grouping and suffix resolution to recognize models with
customModel(using itsproviderwhenproviderNameis absent). - Add a localized hover line describing the contributing owner/key, plus unit tests for deserialization and suffix behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtils.java | Use customModel.provider as a suffix source when providerName is absent. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/ModelHoverContentProvider.java | Render an extra hover line for contributed custom models. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/messages.properties | Add the new localized hover message template. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/Messages.java | Declare the new NLS message key. |
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ModelPickerGroupsBuilder.java | Group customModel-bearing models under the Custom Models section. |
| com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtilsTests.java | Add tests for suffix selection behavior involving customModel. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotModel.java | Add customModel record and include it in equality/hash/toString. |
| com.microsoft.copilot.eclipse.core.test/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotModelTests.java | Add Gson deserialization + equality/hash coverage for customModel. |
|
@iloveeclipse, I remember Mykola asked about the org leveled custom model, and this is it. |
|
@jdneo: could you trigger a nightly build? BTW, last ("old") nightly doesn't seem to be available anymore (yesterday it was OK): |
|
@iloveeclipse how did you trigger this error? It seems work on my side
|
I see the entry like yours, but if I continue with installation, the error is reported. Yesterday it was OK. |



Summary
Organization- and enterprise-contributed BYOK models are returned by the
language server through
copilot/modelswith acustomModelpayload (insteadof a
providerName). This PR consumes that metadata so these models appearautomatically in the chat model picker — the user does not need to configure
their own API key.
Changes
customModel(keyName,ownerName,ownerType,provider) to theCopilotModeltype, includingequals/hashCode/toString.customModelare grouped under theCustom Models section, and their
provideris used as the picker suffix(mirroring BYOK models that arrive with a
providerName).<model> is contributed by <owner> using <key>line in themodel hover, matching the IntelliJ tooltip.
model_hover_customModelInfomessage.Tests
CopilotModelTests—customModelGson deserialization (present / absent) andequals/hashCodecoverage.ModelUtilsTests— suffix resolution usescustomModel.provider, withproviderNametaking precedence../mvnw verifypasses (checkstyle: 0 violations; all core + ui tests green).