Fix stale chat input warning message#314594
Closed
pwang347 wants to merge 3 commits into
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses stale chat input quota/limit notifications by ensuring ChatQuotaService clears previously cached quota data when authentication changes and no longer provides quota information (e.g. sign-out), preventing UI warnings from persisting across accounts/sessions.
Changes:
- Clear cached quota/rate-limit state and emit
onDidChangewhen an auth change occurs without validquotaInfo. - Add a new Vitest suite covering quota initialization, exhaustion logic, and clearing behavior on sign-out / missing quota info.
- Validate that clearing triggers change events only when there was prior quota state.
Show a summary per file
| File | Description |
|---|---|
| extensions/copilot/src/platform/chat/test/common/chatQuotaService.spec.ts | Adds unit tests for ChatQuotaService quota state transitions and onDidChange behavior during auth changes. |
| extensions/copilot/src/platform/chat/common/chatQuotaServiceImpl.ts | Clears stale quota/rate-limit state on auth changes where quota info is missing, and fires onDidChange when clearing occurs. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
| // Clear stale quota data when auth changes without quota info | ||
| // (e.g. user signed out). This ensures quota-exhausted | ||
| // notifications from the previous account don't persist. | ||
| if (this._quotaInfo) { |
Contributor
Screenshot ChangesBase: Changed (11) |
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.
Fixes #314436