Skip to content

Update in-chat message for credit limit#315135

Draft
pwang347 wants to merge 1 commit intomainfrom
pawang/updateMessage
Draft

Update in-chat message for credit limit#315135
pwang347 wants to merge 1 commit intomainfrom
pawang/updateMessage

Conversation

@pwang347
Copy link
Copy Markdown
Member

@pwang347 pwang347 commented May 7, 2026

No description provided.

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

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_billing to Copilot user/token metadata and expose it via CopilotToken.
  • Extend getErrorDetailsFromChatFetchError to accept tokenBasedBilling + quotaResetDate and 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']
});
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.

2 participants