Skip to content

Reduce task API traffic #345934

Closed
Closed

Description

@roblourens

Fixed in #345926

We still hit the task API too eagerly when push notifications are being received through the websocket. This eliminates the forced refresh on windows focus.

Activity

  1. added this to the 1.145.0 milestone on Nov 3, 2026
  2. self-assigned this
    on Nov 3, 2026
  3. added
    bug
    candidate
    on Nov 3, 2026
  4. vs-code-engineering commented on Nov 3, 2026

    @vs-code-engineering
    Contributor

    Sharing media and context from merged PR #345926 for verification:

    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)

    Screenshot Changes

    Base: 7a8a4e5a Current: f2840d1b

    Changed (1)

    sessions/artifactIntegrations/PullRequestCommentsInformation/Light
    Before After
    before after

    Screenshot report: #345926 (comment)

    Source PR: #345926

  5. added
    verified
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcandidateverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions