Skip to content

Suppress rate-limit/quota-exceeded errors from chatAgentError telemetry#312239

Merged
bryanchen-d merged 3 commits intomainfrom
copilot/suppress-rate-limits-error
Apr 23, 2026
Merged

Suppress rate-limit/quota-exceeded errors from chatAgentError telemetry#312239
bryanchen-d merged 3 commits intomainfrom
copilot/suppress-rate-limits-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

ChatRateLimited errors thrown by the Copilot extension's _provideLanguageModelResponse were surfacing as unhandled errors in the chatAgentError telemetry, despite being expected operational conditions that are already handled gracefully in the UI.

Changes

  • src/vs/workbench/api/browser/mainThreadChatAgents2.ts: Skip the publicLogError2('chatAgentError') call when rpcResult.errorDetails?.isRateLimited or isQuotaExceeded is set. Both flags are already populated upstream in extHostChatAgents2.ts based on the error name (ChatRateLimited / ChatQuotaExceeded), so no additional plumbing is needed. The error details continue to flow to the UI layer unchanged.
if (rpcResult?.errorCallstack && !rpcResult.errorDetails?.isRateLimited && !rpcResult.errorDetails?.isQuotaExceeded) {
    this._telemetryService.publicLogError2<ChatAgentErrorEvent, ChatAgentErrorClassification>('chatAgentError', { ... });
}

This corresponds to "fix location 2" from the investigation comment on the issue.

Copilot AI requested review from Copilot and removed request for Copilot April 23, 2026 22:03
Copilot AI changed the title [WIP] Suppress rate limits exceeded from agents error reporting Suppress rate-limit/quota-exceeded errors from chatAgentError telemetry Apr 23, 2026
Copilot AI requested a review from bryanchen-d April 23, 2026 22:04
@bryanchen-d bryanchen-d marked this pull request as ready for review April 23, 2026 22:20
Copilot AI review requested due to automatic review settings April 23, 2026 22:20
@bryanchen-d bryanchen-d enabled auto-merge April 23, 2026 22:20
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 reduces noise in workbench telemetry by suppressing chatAgentError telemetry for expected operational failures (rate limiting / quota exceeded) coming from chat agent invocation, while leaving UI error handling unchanged.

Changes:

  • Add a guard to skip publicLogError2('chatAgentError') when rpcResult.errorDetails?.isRateLimited or isQuotaExceeded is set.
  • Document the rationale inline and link to the tracking issue.
Show a summary per file
File Description
src/vs/workbench/api/browser/mainThreadChatAgents2.ts Prevents logging expected rate-limit/quota errors to chatAgentError telemetry while preserving error details for the UI layer.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@bryanchen-d bryanchen-d merged commit e538664 into main Apr 23, 2026
26 checks passed
@bryanchen-d bryanchen-d deleted the copilot/suppress-rate-limits-error branch April 23, 2026 22:48
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 23, 2026
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.

[Error Telemetry] Suppress rate limits exceeded from Agents error reporting

4 participants