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.
Skip the UpstreamHealthProviderCheck if the window is not focused, and try again when the window becomes focused again. Some users have OS firewalls that make periodic background network access annoying for users. See https://linear.app/sourcegraph/issue/CODY-3745/codys-background-periodic-network-access-causes-2fa.
This check is used to gather latency information to properly measure actual latency for autocomplete. As long as the user has VS Code focused for slightly more than 10 seconds, it will still gather the necessary latency information for these calculations.
Fixes https://linear.app/sourcegraph/issue/CODY-3745/codys-background-periodic-network-access-causes-2fa
Test plan
Open VS Code and check logs for the UpstreamHealthProvider call. Ensure that it does not trigger when the window is not focused, and then it triggers within 10 seconds of being focused after that.
Changelog
Suppressed Cody's background process for monitoring latency to the Sourcegraph endpoint, which was used to calculate autocomplete latency for performance tracking purposes. For users with OS firewalls that notify on background network access, this will reduce notification annoyance.