Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete: Remove cody-autocomplete-streaming-response flag #995

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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