Skip to content

fix: Updated token pricing model with context size and tier details#316

Merged
jdneo merged 5 commits into
mainfrom
ethan/update-model-default-context-size
Jun 24, 2026
Merged

fix: Updated token pricing model with context size and tier details#316
jdneo merged 5 commits into
mainfrom
ethan/update-model-default-context-size

Conversation

@ethanyhou

@ethanyhou ethanyhou commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Align context size calculation algorithm with Intellij:
image
image

Copilot AI review requested due to automatic review settings June 23, 2026 08:56

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

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 ModelInfo protocol payload with an optional contextSize field.
  • 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 jdneo merged commit 799f24b into main Jun 24, 2026
4 checks passed
@jdneo jdneo deleted the ethan/update-model-default-context-size branch June 24, 2026 03:17
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