Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: split min latency flags (#1351)
RE: https://sourcegraph.slack.com/archives/C05AGQYD528/p1696845420506809 refactor: replace cody autocomplete minimum latency flag with user, provider, and language based latency flags Replaced the `CodyAutocompleteMinimumLatency` feature flag with two new flags: - `CodyAutocompleteUserLatency `: Enables minimum latency for Cody autocomplete. Works the same as the old `CodyAutocompleteMinimumLatency` flag but rename it to make sure the old flag will not be used in older versions. - `CodyAutocompleteLanguageLatency`: Enables language-specific minimum latency for Cody autocomplete for low-performance languages ONLY - `CodyAutocompleteProviderLatency`: Enables provider-specific minimum latency for non-anthropic provider Expected behavior: - latency for comments will be applied if any of the feature flags is enabled - latency for user-based actions will only be applied if `CodyAutocompleteUserLatency` is enabled - latency for language-based actions will only be applied if `CodyAutocompleteLanguageLatency` is enabled - latency for provider-based actions will only be applied if `CodyAutocompleteProviderLatency` is enabled The getLatency function now accepts feature flags and calculates latency accordingly. This allows more granular control over autocomplete latency based on user, provider, and language. ## Test plan <!-- Required. See https://docs.sourcegraph.com/dev/background-information/testing_principles. --> Unit tests are updated. --------- Co-authored-by: Philipp Spiess <hello@philippspiess.com> Co-authored-by: Dominic Cooney <dominic.cooney@sourcegraph.com>
- Loading branch information