Skip to content

Make Copilot Autopilot request-error retry count configurable #313485

Description

@dunxuan

Description

Copilot Agent currently auto-retries failed chat/model requests in autoApprove and autopilot permission modes. From the source, this appears to be controlled by a hard-coded value in ToolCallingLoop:

private static readonly MAX_AUTOPILOT_RETRIES = 3;

This retry behavior is useful for transient network failures, but the fixed retry count is not always ideal.

For example:

  • On flaky networks, 3 retries may be too few.
  • For deterministic failures such as 400 or 413 request errors, retrying 3 times can waste time and make the chat output noisy.
  • Users may see repeated messages such as Retried with Autopilot / Autopilot recovered from a request error, but cannot tune the retry behavior.
  • The existing chat.agent.maxRequests setting appears to control agent/tool-call iteration limits, not request-error retry attempts.

Request

Please add a user/workspace setting to configure the request-error retry count for Copilot Agent auto-approve/autopilot mode.

Possible setting names:

"chat.agent.maxRequestErrorRetries": 3

or:

"github.copilot.chat.autopilot.maxRequestErrorRetries": 3

A value of 0 could disable automatic retries, while the default could remain 3 to preserve current behavior.

Why this would help

This would let users tune Copilot Agent behavior based on their environment:

  • Increase retries when working on unstable network connections.
  • Reduce or disable retries when errors are usually deterministic, such as oversized requests or invalid request payloads.
  • Avoid repeated failed retry messages in long-running Autopilot sessions.
  • Make the behavior clearer and more controllable, separate from chat.agent.maxRequests.

Related behavior

The retry log currently looks like:

[ToolCallingLoop] Auto-retrying on error (attempt 3/3): failed

and the UI may show repeated Autopilot retry/recovery messages before eventually failing.

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions