Skip to content

Commit

Permalink
Autocomplete: Remove cody-autocomplete-streaming-response flag (#995)
Browse files Browse the repository at this point in the history
Removing the feature flag, we've shipped this feature to 100% and now
it's time for enterprise customers to also get this goodie.

## Test plan

👀 

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
  • Loading branch information
philipp-spiess committed Sep 11, 2023
1 parent 0fa0bc4 commit ae8488b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion lib/shared/src/experimentation/FeatureFlagProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export enum FeatureFlag {

CodyAutocompleteTracing = 'cody-autocomplete-tracing',
CodyAutocompleteIncreasedDebounceTimeEnabled = 'cody-autocomplete-increased-debounce-time-enabled',
CodyAutocompleteStreamingResponse = 'cody-autocomplete-streaming-response',
CodyAutocompleteStarCoder7B = 'cody-autocomplete-default-starcoder-7b',
CodyAutocompleteStarCoder16B = 'cody-autocomplete-default-starcoder-16b',
CodyAutocompleteClaudeInstantInfill = 'cody-autocomplete-claude-instant-infill',
Expand Down
1 change: 1 addition & 0 deletions vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Starting from `0.2.0`, Cody is using `major.EVEN_NUMBER.patch` for release versi
### Changed

- Remove `starter` and `premade` fields from the configuration files for custom commands (cody.json). [pull/939](https://github.com/sourcegraph/cody/pull/939)
- Enabled streaming responses for all autocomplete requests. [pull/995](https://github.com/sourcegraph/cody/pull/995)

## [0.10.1]

Expand Down
12 changes: 4 additions & 8 deletions vscode/src/completions/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ export function createClient(
async complete(params, onPartialResponse, signal): Promise<CompletionResponse> {
const log = logger?.startCompletion(params)

const [tracingFlagEnabled, streamingResponseFlagEnable] = featureFlagProvider
? await Promise.all([
featureFlagProvider.evaluateFeatureFlag(FeatureFlag.CodyAutocompleteTracing),
featureFlagProvider.evaluateFeatureFlag(FeatureFlag.CodyAutocompleteStreamingResponse),
])
: [false, false]
const tracingFlagEnabled = await featureFlagProvider?.evaluateFeatureFlag(
FeatureFlag.CodyAutocompleteTracing
)

const headers = new Headers(config.customHeaders)
// Force HTTP connection reuse to reduce latency.
Expand All @@ -62,8 +59,7 @@ export function createClient(
// TODO(philipp-spiess): Feature test if the response is a Node or a browser stream and
// implement SSE parsing for both.
const isNode = typeof process !== 'undefined'

const enableStreaming = !!isNode && !!streamingResponseFlagEnable
const enableStreaming = !!isNode

const url = getCodeCompletionsEndpoint()
const response: Response = await fetch(url, {
Expand Down

0 comments on commit ae8488b

Please sign in to comment.