Skip to content

Pause automatic inline completions on metered connections - #331691

Open
Dmitriy Vasyura (dmitrivMS) wants to merge 6 commits into
mainfrom
dev/dmitriv/metered-inline-completions
Open

Pause automatic inline completions on metered connections#331691
Dmitriy Vasyura (dmitrivMS) wants to merge 6 commits into
mainfrom
dev/dmitriv/metered-inline-completions

Conversation

@dmitrivMS

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

Copy link
Copy Markdown
Collaborator
  • add proposed meteredNetworkAware inline-completion provider metadata, defaulting to false; providers opt in when they are local-only or handle metered connections themselves
  • filter automatic providers that are not metered-network aware before applying provider-group exclusions, and recompute eligibility after debounce immediately before provider dispatch
  • preserve metered-network-aware providers, explicit user-triggered requests, and requests already in flight when the connection becomes metered
  • refresh active automatic sessions when providers become available without activating stopped sessions or cancelling matching explicit work
  • ignore content-change signals from providers that are unavailable for automatic requests
  • mark the built-in local-only Emmet provider as metered-network aware; keep network-capable Copilot providers on the safe default
  • add regression coverage for provider selection, debounce transitions, inactive sessions, explicit request reuse, cache invalidation, and request lifetime behavior

Fixes #297407
Fixes #297412

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 19, 2026 19:01
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added network Network related issues inline-completions editor-api Issues about the API of vscode in the area of editors labels 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 network-backed inline completions on metered connections while preserving explicit and in-flight requests.

Changes:

  • Adds provider network-usage metadata and RPC propagation.
  • Gates automatic network-backed provider calls.
  • Adds coverage for metered-connection behavior.
Show a summary per file
File Description
src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts Adds network-usage metadata.
src/vs/workbench/api/common/extHostLanguageFeatures.ts Sends metadata through RPC.
src/vs/workbench/api/common/extHost.protocol.ts Extends the RPC contract.
src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts Applies the metered-connection gate.
src/vs/workbench/api/test/browser/extHostLanguageFeatures.test.ts Tests gating and preserved requests.

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/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/vs/workbench/api/common/extHostLanguageFeatures.ts Outdated
Comment thread src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts Outdated
Comment thread src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts
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

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

Comment thread src/vs/workbench/api/browser/mainThreadLanguageFeatures.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

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

Comment thread src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts Outdated
Comment thread src/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.ts Outdated
Comment thread src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts Outdated
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 20, 2026 21:14

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: 11/12 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor-api Issues about the API of vscode in the area of editors inline-completions network Network related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metered connection: opening local files uses data Disable completions on metered connections

2 participants