fix: Updated token pricing model with context size and tier details#316
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Eclipse client’s understanding of token-based billing metadata so model pricing/context details align with the language server’s tiered token pricing shape and context window calculation rules.
Changes:
- Compute model context window size using token price tiers (default tier maxContext + maxOutputTokens), with fallbacks to token limits / advertised context window.
- Extend
ModelInfoprotocol payload with an optionalcontextSizefield. - Reshape token pricing protocol types to support per-tier pricing (
default/longContext) and proper JSON deserialization.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtils.java | Updates model suffix context window calculation to mirror tier-aware token billing behavior. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ModelInfo.java | Adds contextSize to the model metadata record for LSP payloads. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotModel.java | Introduces tiered token pricing records (default/longContext) and batch sizing for prices. |
| com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java | Updates ModelInfo construction to match the new record signature. |
jdneo
reviewed
Jun 24, 2026
…ctor and update ActionBar setup
jdneo
approved these changes
Jun 24, 2026
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.
Align context size calculation algorithm with Intellij:

