Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Copilot Chat quota-exceeded messaging to better reflect token-based billing “credit limit” scenarios by surfacing token-based billing info from authentication into the shared chat error messaging helpers.
Changes:
- Add
token_based_billingto Copilot user/token metadata and expose it viaCopilotToken. - Extend
getErrorDetailsFromChatFetchErrorto accepttokenBasedBilling+quotaResetDateand thread those through call sites. - For free-plan
quota_exceeded, show a “monthly credit limit” message including a formatted reset date when token-based billing info is available.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/chat/common/commonTypes.ts | Adds token-based billing/reset-date aware quota message and threads new args through error-details helpers. |
| extensions/copilot/src/platform/authentication/node/copilotTokenManager.ts | Includes token_based_billing in the extended token info built from user info. |
| extensions/copilot/src/platform/authentication/common/copilotToken.ts | Adds tokenBasedBilling getter and updates token/user-info typings to carry token_based_billing. |
| extensions/copilot/src/extension/prompts/node/codeMapper/codeMapper.ts | Passes token-based billing + quota reset date into shared chat error detail builder. |
| extensions/copilot/src/extension/prompt/node/defaultIntentRequestHandler.ts | Passes token-based billing + quota reset date into shared chat error detail builder. |
| extensions/copilot/src/extension/inlineChat2/node/inlineChatIntent.ts | Passes token-based billing + quota reset date into shared chat error detail builder. |
| extensions/copilot/src/extension/conversation/vscode-node/languageModelAccess.ts | Passes token-based billing + quota reset date into shared chat error detail builder for quota exceeded errors. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 1
Comment on lines
+337
to
+342
| const resetDateString = new Date(quotaResetDate).toLocaleString(undefined, { year: 'numeric', month: 'long', day: 'numeric' }); | ||
| return l10n.t({ | ||
| message: `You've reached your monthly credit limit. Upgrade to Copilot Pro or wait until your credits reset on {0}.`, | ||
| args: [resetDateString], | ||
| comment: ['{0} is the date when credits reset'] | ||
| }); |
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.
No description provided.