Skip to content

feat: Implement legacy fallback for quota warnings and update messages before TBB#211

Merged
jdneo merged 10 commits into
mainfrom
ethan/fallback-before-tbb
May 15, 2026
Merged

feat: Implement legacy fallback for quota warnings and update messages before TBB#211
jdneo merged 10 commits into
mainfrom
ethan/fallback-before-tbb

Conversation

@ethanyhou
Copy link
Copy Markdown
Contributor

@ethanyhou ethanyhou commented May 15, 2026

This PR is a fallback of: #186

Test:

  1. login with eclipse-pro account.
  2. When no quota, Copilot should auto switch to the fallback model:
image

Copilot AI review requested due to automatic review settings May 15, 2026 09:27
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

This PR adds legacy pre-TBB quota fallback handling and extends the model picker/chat request flow to support selectable reasoning effort metadata.

Changes:

  • Adds reasoning-effort protocol fields, preference persistence, picker/hover UI, and per-turn rendering/persistence.
  • Updates chat requests to send modelInfo.reasoningEffort.
  • Restores legacy 402 quota fallback messaging/replay behavior when token-based billing is not enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/utils/ModelUtils.java Adds reasoning-effort helpers and updates model suffix formatting.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/ModelHoverContentProvider.java Adds interactive thinking-effort rows to model hover content.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/ItemController.java Extends row hover/focus behavior for reusable popup rows.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/IDropdownItemHoverProvider.java Adds a close callback for interactive hover content.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java Keeps hover popups open for interaction and supports hover-triggered close.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownItem.java Adds optional selected button-face labels.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownButton.java Uses selected labels and updates width when items change.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/messages.properties Adds localized reasoning-effort labels/descriptions.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/i18n/Messages.java Adds NLS fields for new messages.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/services/ModelService.java Persists reasoning-effort choices and rebuilds model picker items.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ModelPickerGroupsBuilder.java Includes effective reasoning effort in model item suffix/selected label.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/CopilotTurnWidget.java Renders reasoning effort in model footer text.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatView.java Sends, renders, and persists per-turn reasoning effort.
com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/chat/ChatContentViewer.java Adds legacy quota warning fallback and replay behavior.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/persistence/CopilotTurnData.java Persists reasoning effort in reply data.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/persistence/ConversationPersistenceManager.java Stores reasoning effort with model info.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ModelInfo.java Adds model metadata payload for chat protocol requests.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/CopilotModel.java Adds reasoning-effort capability metadata and model key helper.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationTurnParams.java Adds modelInfo to turn params.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/protocol/ConversationCreateParams.java Adds modelInfo to create params.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/lsp/CopilotLanguageServerConnection.java Sends modelInfo.reasoningEffort on chat requests.
com.microsoft.copilot.eclipse.core/src/com/microsoft/copilot/eclipse/core/chat/UserPreference.java Stores reasoning-effort selections per model.
Comments suppressed due to low confidence (1)

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

  • This hover section also ignores the new supportsReasoningEffortLevel() gate and will render selectable effort rows whenever the raw list has more than one entry, even if the server says the model/endpoint does not support effort selection. Please base this on ModelUtils.getSupportedReasoningEfforts(model) after that helper checks the support flag, or explicitly require supports.supportsReasoningEffortLevel() here.
    sectionLayout.marginHeight = 0;
    sectionLayout.verticalSpacing = 2;
    ((GridData) section.getLayoutData()).verticalIndent = SECTION_SPACING;

@jdneo jdneo merged commit 75f108f into main May 15, 2026
4 checks passed
@jdneo jdneo deleted the ethan/fallback-before-tbb branch May 15, 2026 09:51
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