Skip to content

[Perf] [1.145] chat: skip focus discovery with a connected feed - #345926

Merged
Aaron Munger (amunger) merged 3 commits into
release/1.145from
roblou/agents/cloud-sandbox-focus-release-1.145
Nov 3, 2026
Merged

Aaron Munger (amunger) merged 3 commits into
release/1.145from
roblou/agents/cloud-sandbox-focus-release-1.145

Conversation

@roblourens

@roblourens roblourens commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #345934

Backport of #345897 to release/1.145, porting ad150315b02 and 7ba4e56174a. Part of #345234.

Summary

  • Carry automatic intent from Chat's window-focus handler through the sessions control instead of treating focus as manual Refresh.
  • Skip cloud inventory scans on focus, host selection, and automatic UI refresh while the task-status feed is connected. Keep stale fallback refreshes without a connected feed.
  • Preserve explicit Refresh, manual intent when requests coalesce, startup/account/configuration scans, targeted push updates, and existing feed renewal/reconnect catch-up.

The port adapts the refresh-type export and tests to the release branch's older model/test contexts. The Agents window's session-list refresh is local-only on this branch too and is preserved. No unrelated main changes or separate renewal/reconciliation implementation are included; polling intervals, feed transport, and discovery APIs are unchanged.

Readiness: safety-refresh policy

Keep this as a draft pending the same catalogue-recovery policy and evidence as the main PR. The feed is best effort, not a complete catalogue: deletes/shares/pins never hint, and new/out-of-lease/organization tasks can be missed.

Mandatory renewal and reconnect refetches are preserved. Connected-state scheduled polling was already suppressed before this port; the broader gate removes additional focus/selection/UI refresh opportunities. Whether renewal refetches alone supply the accepted safety backstop remains an explicit upstream open question.

Renewals can read incrementally and retain missing entries. The fifteen-minute constant is full-scan eligibility, not a maximum reconciliation 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.

Before readiness:

  • Agree the safety-refresh interpretation and acceptable missing-entry latency, including failures.
  • Exercise deliberately dropped hints and new/out-of-lease/organization tasks without relying on focus.
  • Exercise deletion without a task.deleted hint, incremental retention, later complete full reconciliation, and connected/provisioning retention.
  • Verify failed/partial scans do not falsely declare completeness or removals, using equivalent recovery cases on main and release.

Current callback/gating and direct-renewal tests are not end-to-end proof of those recovery cases. This port adds no timer and imports no withdrawn renewal-suppression code.

How to Test

  1. Enable cloud sandboxes in an authenticated test profile and let initial discovery and the task-status feed connect.
  2. Refocus the window with the feed connected, including after the normal freshness interval. Focus and automatic UI refreshes should not start cloud discovery.
  3. Use Refresh Agent Sessions in the editor Chat sessions sidebar. Explicit Refresh should still discover with the feed connected.
  4. With the feed disabled/unavailable in the test profile, verify that focus can still refresh stale inventory.

Live checks are from the main-branch implementation, not a new release-branch live run: four actual native focus-ins while fresh issued no additional list requests; an aged connected-feed provider/control check issued zero scans while explicit toolbar Refresh completed a 21-page scan. A real repo-less sandbox was opened through the UI and replied OK without tool calls. All created test resources were removed.

The aged connected-feed check is provider/control-level evidence, not native-OS-event proof. The earlier external-archive repair was a fallback poll, not a stale-focus-specific live pass. No production savings estimate is claimed.

(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]>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 21:25

Copilot AI commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

One or more custom setup steps configured for this repository failed during this Copilot code review run:

Setup pnpm

Setup steps run before each review. If the review above is missing context, or no review was posted at all, the failing step above may be the cause. See the workflow run for failure details, fix your setup steps configuration, and re-request a review.

Note

You can configure setup steps for Copilot code review separately from Copilot cloud agent with a copilot-code-review.yml file. Read the docs for details.

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.

🟢 Approval recommended

No active review issues are reported for the cloud sandbox discovery optimization backport.

No open issues 🎉

What changed in this PR

Backports the cloud sandbox discovery optimization to release/1.145, reducing redundant inventory requests while the task-status feed is connected.

Changes:

  • Carries automatic refresh intent from Chat window focus through the sessions control, while preserving explicit manual Refresh.
  • Skips focus, host-selection, and automatic UI scans with a connected feed; preserves stale fallback discovery and feed catch-up.
  • Adds regression coverage and updates provider documentation. Feed transport, polling intervals, and discovery APIs remain unchanged.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​widgetHosts/​viewPane/​chatViewPane.test.ts Tests automatic focus refresh and manual toolbar intent.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​remoteAgentHost/​editorCloudSandboxContribution.test.ts Tests connected-feed suppression, startup reuse, and manual refresh.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentSessionViewModel.test.ts Tests manual precedence and providers without freshness policies.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentSessionsControl.test.ts Verifies 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/​remoteAgentHost/​cloudSandboxSessionContribution.ts Skips freshness-gated discovery when the feed is connected.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentSessionsModel.ts Exports the refresh-reason type for shared use.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentSessionsControl.ts Forwards refresh intent to the model.
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 Confirms repeated list refreshes remain local-only.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​cloudSandboxAgentHostContribution.test.ts Covers feed catch-up, scan suppression, and disconnected fallback.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents connected-feed suppression and fallback behavior.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 7a8a4e5a Current: f2840d1b

Changed (1)

sessions/artifactIntegrations/PullRequestCommentsInformation/Light
Before After
before after

roblourens and others added 2 commits November 3, 2026 15:41
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]>
@amunger
Aaron Munger (amunger) merged commit a717861 into release/1.145 Nov 3, 2026
143 of 147 checks passed
@amunger
Aaron Munger (amunger) deleted the roblou/agents/cloud-sandbox-focus-release-1.145 branch November 3, 2026 23:03
@vs-code-engineering vs-code-engineering Bot added this to the 1.145.0 milestone Nov 3, 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.

3 participants