Skip to content

Pause plugin auto-updates on metered connections - #331694

Merged
Dmitriy Vasyura (dmitrivMS) merged 10 commits into
mainfrom
dev/dmitriv/metered-plugin-auto-update
Aug 20, 2026
Merged

Pause plugin auto-updates on metered connections#331694
Dmitriy Vasyura (dmitrivMS) merged 10 commits into
mainfrom
dev/dmitriv/metered-plugin-auto-update

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator
  • pause the periodic agent-plugin marketplace update check while the connection is metered
  • preserve the startup-idle gate when the connection becomes unmetered during startup
  • preserve queued plugin updates and resume them when the connection becomes unmetered
  • defer periodic repository checks while marketplace updates are queued, then re-arm checks after the final queued update is acknowledged
  • allow checks and updates that were already in flight to finish, while blocking new automatic work
  • leave manual plugin update commands unchanged

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 19, 2026 19:10
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added the network Network related issues label Aug 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pauses automatic agent-plugin update checks and installs on metered connections while preserving queued work.

Changes:

  • Suspends and resumes periodic marketplace checks.
  • Cancels in-flight automatic updates and retains queued IDs.
  • Adds metered-connection lifecycle tests.
Show a summary per file
File Description
pluginMarketplaceService.ts Gates periodic checks on connection state.
pluginAutoUpdate.ts Pauses, cancels, and resumes automatic updates.
pluginMarketplaceService.test.ts Tests periodic-check pause and resume.
pluginAutoUpdate.test.ts Tests queue retention and cancellation.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.ts Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:426

  • This unmetered path can bypass the existing startup-idle gate: if the service starts metered and the connection becomes unmetered before the runWhenGlobalIdle callback runs, it schedules an overdue repository check immediately and can start git/network work during startup. Register this listener inside the idle callback; the initial _scheduleUpdateCheck() already observes the latest metered state, so transitions before idle do not need a separate listener.
				this._scheduleUpdateCheck();
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.ts Outdated
Comment thread src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts Outdated
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 20, 2026 20:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 20, 2026 20:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (2)

src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:876

  • Revalidate the queued-update barrier when the delayed task actually starts. A configuration change during an active check can already have placed a rerun in Throttler; if the active check then reports updates, PluginAutoUpdate starts pulling them, but this queued rerun only checks the metered state and proceeds with fetchRepository concurrently. Checking marketplacesWithUpdates here lets the final acknowledgement re-arm the periodic check after the pull completes.
	private async _doRunUpdateCheck(): Promise<void> {
		if (this._meteredConnectionService.isConnectionMetered) {
			return;

src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.ts:421

  • Clearing the queue here bypasses the new repository-operation barrier. If configuration changes while PluginAutoUpdate is still pulling a queued marketplace, that update keeps running from its snapshot, but the zero-delay check now sees an empty queue and can start fetchRepository against the same checkout. When this happens while metered, the queued IDs are also discarded and the blocked immediate check is not remembered, so unmetering can postpone reconsideration until the next daily interval. Preserve the acknowledgement barrier and track the configuration-triggered recheck separately until automatic work is allowed.
				this._marketplacesWithUpdates.set(new Set(), undefined);
				this._scheduleUpdateCheck(0);
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 3eb0bec into main Aug 20, 2026
28 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the dev/dmitriv/metered-plugin-auto-update branch August 20, 2026 23:44
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-plugins network Network related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants