Skip to content

feat: Surface organization-enabled custom (BYOK) models#333

Merged
jdneo merged 4 commits into
mainfrom
tori/customModels
Jul 3, 2026
Merged

feat: Surface organization-enabled custom (BYOK) models#333
jdneo merged 4 commits into
mainfrom
tori/customModels

Conversation

@xinyi-gong

@xinyi-gong xinyi-gong commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Organization- and enterprise-contributed BYOK models are returned by the
language server through copilot/models with a customModel payload (instead
of a providerName). This PR consumes that metadata so these models appear
automatically in the chat model picker — the user does not need to configure
their own API key.

Changes

  • Protocol: add customModel (keyName, ownerName, ownerType,
    provider) to the CopilotModel type, including equals/hashCode/
    toString.
  • Model picker grouping: models carrying customModel are grouped under the
    Custom Models section, and their provider is used as the picker suffix
    (mirroring BYOK models that arrive with a providerName).
  • Hover: show a <model> is contributed by <owner> using <key> line in the
    model hover, matching the IntelliJ tooltip.
  • i18n: add the model_hover_customModelInfo message.

Tests

  • CopilotModelTestscustomModel Gson deserialization (present / absent) and
    equals/hashCode coverage.
  • ModelUtilsTests — suffix resolution uses customModel.provider, with
    providerName taking precedence.
  • ./mvnw verify passes (checkstyle: 0 violations; all core + ui tests green).
image

Copilot AI review requested due to automatic review settings July 1, 2026 08:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 CopilotModel protocol type with a customModel payload and incorporate it into equals/hashCode/toString.
  • Update model picker grouping and suffix resolution to recognize models with customModel (using its provider when providerName is 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.

@jdneo jdneo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The selected model is not same as the turn footer

Image

@xinyi-gong

Copy link
Copy Markdown
Member Author

The selected model is not same as the turn footer

Image

Fixed: the client now sends the concrete model id (modelInfo.id) instead of only the non-unique family, so the server uses the exact selected model and the footer matches the picker.

@jdneo jdneo merged commit 22ab037 into main Jul 3, 2026
6 of 7 checks passed
@jdneo jdneo deleted the tori/customModels branch July 3, 2026 05:04
@jdneo

jdneo commented Jul 3, 2026

Copy link
Copy Markdown
Member

@iloveeclipse, I remember Mykola asked about the org leveled custom model, and this is it.

@iloveeclipse

Copy link
Copy Markdown

@jdneo: could you trigger a nightly build?

BTW, last ("old") nightly doesn't seem to be available anymore (yesterday it was OK):

An error occurred while collecting items to be installed
session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,com.microsoft.copilot.eclipse.branding,0.19.0.202606300450_nightly
Can't download artifact osgi.bundle,com.microsoft.copilot.eclipse.branding,0.19.0.202606300450_nightly required by com.microsoft.copilot.eclipse.branding[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.core.agent.linux.x64[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.ui[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.branding[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.core[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.terminal.api[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.feature.feature.group[0.19.0.202606300450_nightly], com.microsoft.copilot.eclipse.ui.jobs[0.19.0.202606300450_nightly]

@jdneo

jdneo commented Jul 3, 2026

Copy link
Copy Markdown
Member

@iloveeclipse how did you trigger this error?

It seems work on my side

image

@iloveeclipse

Copy link
Copy Markdown

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants