Repository navigation
[Perf] chat: avoid cloud discovery on focus with a connected feed - #345897
Merged
Merged
Conversation
Route window-focus session refreshes through the existing automatic freshness gate while preserving explicit Refresh and coalesced manual intent. Keep providers without a freshness policy and the Agents window's local catalogue refresh unchanged. Related to #345234. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review reports no active issues with the change to reduce unnecessary cloud sandbox discovery requests.
No open issues 🎉
What changed in this PR
This PR reduces unnecessary cloud sandbox discovery requests by marking Chat’s window-focus refreshes as automatic, allowing the provider’s existing freshness checks to apply.
Changes:
- Forward refresh intent through the sessions control while keeping explicit Refresh manual.
- Add regression coverage for focus handling, manual-refresh precedence, and providers without freshness policies.
- Verify that the Agents window retains local-only catalogue refresh behavior.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/widgetHosts/viewPane/chatViewPane.test.ts |
Tests automatic focus refreshes and manual toolbar refresh intent. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionViewModel.test.ts |
Tests coalescing precedence and providers without freshness policies through the control. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentSessionsControl.test.ts |
Tests refresh-reason forwarding and the manual default. |
src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts |
Marks window-focus refreshes as automatic. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.ts |
Exports the existing refresh-reason type for reuse. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.ts |
Forwards refresh reasons to the model, defaulting to manual. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.ts |
Adds the optional refresh reason to the control interface. |
src/vs/sessions/contrib/sessions/test/browser/sessionsList.test.ts |
Tests repeated local-only catalogue refreshes. |
Review effort: Balanced
Let a connected task-status feed supply cloud inventory updates instead of scanning on focus, host selection, or automatic UI refresh. Keep disconnected fallback, explicit Refresh, startup, targeted updates, and existing feed catch-up paths unchanged. Related to #345234. Co-authored-by: Copilot <[email protected]>
4 tasks
Document incomplete feed coverage and renewal-driven inventory recovery without promising a fixed full-scan deadline. Keep catalogue-correctness readiness tied to the accepted safety-refresh policy and missed-change evidence. Co-authored-by: Copilot <[email protected]>
Aaron Munger (amunger)
pushed a commit
that referenced
this pull request
Nov 3, 2026
) * chat: backport connected-feed focus suppression (Written by Copilot) Port #345897 to release/1.145, preserving automatic focus intent and suppressing automatic cloud scans while the task-status feed is connected. Keep explicit Refresh and disconnected fallback behavior. Source commits: ad15031 and 7ba4e56. Adapt tests to the release branch's existing model and view contexts; no renewal/reconciliation implementation is included. Co-authored-by: Copilot <[email protected]> * docs: clarify release cloud recovery limits (Written by Copilot) Document the release client's incomplete feed coverage and renewal-driven full-scan eligibility. Do not equate socket connectivity with a complete catalogue or promise a fifteen-minute recovery deadline. Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
This was referenced Nov 3, 2026
roblourens
marked this pull request as ready for review
November 4, 2026 02:25
roblourens
enabled auto-merge (squash)
November 4, 2026 02:25
Justin Chen (justschen)
approved these changes
Nov 4, 2026
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.
Part of #345234.
Summary
Avoid redundant cloud inventory scans when a window gains focus.
automaticintent from Chat's focus handler throughAgentSessionsControlinstead of treating focus as manual Refresh.This PR does not change feed transport, renewal/reconciliation scheduling, polling intervals, or discovery APIs. The separate renewal/reconciliation implementation is not included.
Accepted Limits: Safety Refresh
The maintainer accepted the documented recovery limits for landing this scoped PR. The feed is best effort and incompletely covered: deletes/shares/pins never hint, and new/out-of-lease/organization tasks can be missed. A connected socket and successful rename/archive hints do not prove catalogue correctness.
Mandatory renewal and reconnect refetches remain intact. Connected-state scheduled polling was already suppressed before this PR; the broader gate removes additional focus/selection/UI refresh opportunities and increases reliance on renewal-driven recovery. The upstream contract explicitly leaves renewal-as-safety versus a separate slow timer open; this PR does not resolve that choice.
Renewal reads can be incremental and retain missing entries. Fifteen minutes is full-scan eligibility for a later triggered read, not a deadline. Healthy full-scan gaps can be around 21 minutes, and failures or scan duration can extend them. Complete results also preserve connected/provisioning environments.
Remaining recovery-policy and validation work (not completed or claimed by this PR):
task.deletedhint; verify incremental absence retains it and a later successful complete full read removes it where appropriate. Pin the intended connected/provisioning retention behavior.The existing callback/gating and direct-renewal tests do not establish end-to-end lost-hint/out-of-lease/delete recovery. No new timer or withdrawn renewal-suppression implementation is included.
How to Test
Real-backend checks in isolated authenticated Code OSS profiles:
OKwithout tool calls. All created test resources and run-owned validation instances were cleaned up.The aged connected-feed check exercised the provider/control boundary under Playwright's focused-window environment; it is not native-OS-event proof. The earlier external-archive repair was attributed to fallback polling, not specifically stale focus. These bounded observations are not a production savings estimate.
(Written by Copilot)