feat: [TBB] Update Copilot model capabilities with context size and token limits, and hover details#165
Merged
Merged
Conversation
…imits, and hover details Co-authored-by: Copilot <copilot@github.com>
Contributor
Author
|
@jdneo New codes are commented above, the rest codes remain the same. |
Contributor
There was a problem hiding this comment.
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
CopilotModelprotocol 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 -> {
jdneo
reviewed
May 10, 2026
…arameter Co-authored-by: Copilot <copilot@github.com>
jdneo
approved these changes
May 11, 2026
Member
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.
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:
Full effect with TBB:

Test:
qingyliu/token-based-billingand using a test account