Skip to content

feat: [TBB] Update Copilot model capabilities with context size and token limits, and hover details#165

Merged
jdneo merged 2 commits into
mainfrom
ethan/model-selector-hover
May 11, 2026
Merged

feat: [TBB] Update Copilot model capabilities with context size and token limits, and hover details#165
jdneo merged 2 commits into
mainfrom
ethan/model-selector-hover

Conversation

@ethanyhou
Copy link
Copy Markdown
Contributor

@ethanyhou ethanyhou commented May 9, 2026

This PR is almost identical to https://github.com/microsoft/copilot-eclipse/pull/1614/changes Except the model suffix and model cost in the hover are different.

I merge it to the main branch as the cost info on the hover is guarded by null check:
So without TBB:
image

Full effect with TBB:
image

Test:

  • CLS using qingyliu/token-based-billing and using a test account
  • Accounts:
    • Pro: xcode-pro
    • CB: eclipse-cb
    • CE: MS account but may need extra FFs
    • Free plan: xcode-test
    • ProPlus: xcode-proplus
    • Max: eclipse-proplus

…imits, and hover details

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 9, 2026 07:36
@ethanyhou
Copy link
Copy Markdown
Contributor Author

@jdneo New codes are commented above, the rest codes remain the same.

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

Updates the model metadata surface area (capabilities + billing) and enhances the model picker UI to display context/token limits and cost tiers (incl. token-based billing hover details), aligning the Eclipse client with the newer Copilot model schema.

Changes:

  • Extend CopilotModel protocol types to include capability limits, vendor/price category fields, and token-based billing details.
  • Update model picker suffix/hover rendering to show context size (input/output), context window, and cost tier; adjust hover popup background layout.
  • Add/adjust UI i18n strings and add a unit test to ensure BYOK token limits are preserved during conversion.

Reviewed changes

Copilot reviewed 7 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtils.java Builds multi-part model suffixes; adds token-count and cost-tier formatting; preserves BYOK token limits in capabilities.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/ModelHoverContentProvider.java Reworks hover UI to show context size/window and cost tier; adds arrow icons for input/output token limits.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java Sets explicit hover shell/content background and adjusts hover content margins.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/messages.properties Replaces old hover strings with new context size/window + cost labels.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/Messages.java Updates NLS bindings for the new/removed message keys.
com.microsoft.copilot.eclipse.ui.test/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtilsTests.java Adds test asserting BYOK input/output token limits are preserved in converted CopilotModel capabilities.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotModel.java Adds new protocol fields/types: capability limits, vendor, model picker price category, token-based billing + token prices.
Comments suppressed due to low confidence (1)

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/ModelHoverContentProvider.java:252

  • addSeparator() creates a new SWT Color via CssConstants.getSeparatorColor(display) for every separator, but the Color is never disposed. With the updated hover building multiple sections (and thus multiple separators) each hover open can leak native handles and eventually cause SWT "No more handles" errors. Dispose the Color when the separator composite is disposed, or reuse a cached/theme-managed Color instead of allocating a new one per call.
  private void addSeparator(Composite parent) {
    Composite separator = new Composite(parent, SWT.NONE);
    GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
    gd.heightHint = 1;
    gd.verticalIndent = SECTION_SPACING;
    separator.setLayoutData(gd);
    Display display = parent.getDisplay();
    Color separatorColor = CssConstants.getSeparatorColor(display);
    separator.addPaintListener(e -> {

…arameter

Co-authored-by: Copilot <copilot@github.com>
@jdneo jdneo merged commit d269a2b into main May 11, 2026
4 of 7 checks passed
@jdneo jdneo deleted the ethan/model-selector-hover branch May 11, 2026 07:09
@jdneo
Copy link
Copy Markdown
Member

jdneo commented May 15, 2026

#203

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.

3 participants