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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cody-gateway, sourcegraph: disable code completions for OpenAI #55624

Merged
merged 10 commits into from Aug 9, 2023

Conversation

bobheadxi
Copy link
Member

@bobheadxi bobheadxi commented Aug 7, 2023

Using OpenAI for Cody code completions is currently untested and unsupported. Despite this, we have at least one customer generating very large numbers of OpenAI code completions requests - enough to get us rate limited by OpenAI.

This change:

  • Makes Cody Gateway reject OpenAI code completions requests (responding with 501 not implemented)
  • Prevents Sourcegraph from generating OpenAI code completion requests

Test plan

CI

@cla-bot cla-bot bot added the cla-signed label Aug 7, 2023
@bobheadxi bobheadxi changed the title cody-gateway: disable code completions for OpenAI cody-gateway, sourcegraph: disable code completions for OpenAI Aug 7, 2023
Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, but I'll defer to other people tagged for review here to make the call if this is standing in the way of some other efforts.

internal/completions/client/azureopenai/openai.go Outdated Show resolved Hide resolved
Co-authored-by: Erik Seliger <erikseliger@me.com>
@bobheadxi
Copy link
Member Author

Beyang indicated disabling is likely the right way to go, but will wait for another approval here 👍

@bobheadxi bobheadxi requested a review from a team August 8, 2023 02:48
Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this makes sense, yeah.

Should we add to the docs that enabling OpenAI disables code completions completely? Just so that people aren't confused.

@bobheadxi bobheadxi enabled auto-merge (squash) August 8, 2023 18:21
@bobheadxi bobheadxi merged commit 151f43f into main Aug 9, 2023
14 checks passed
@bobheadxi bobheadxi deleted the cody-gateway-disable-openai-code-completions branch August 9, 2023 17:57
@github-actions
Copy link
Contributor

github-actions bot commented Aug 9, 2023

The backport to 5.1 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-5.1 5.1
# Navigate to the new working tree
cd .worktrees/backport-5.1
# Create a new branch
git switch --create backport-55624-to-5.1
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 151f43ff2b6650d8de83ddc99b5f99e661d39b3e
# Push it to GitHub
git push --set-upstream origin backport-55624-to-5.1
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-5.1

Then, create a pull request where the base branch is 5.1 and the compare/head branch is backport-55624-to-5.1.

@github-actions github-actions bot added backports failed-backport-to-5.1 release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases labels Aug 9, 2023
bobheadxi added a commit that referenced this pull request Aug 9, 2023
Using OpenAI for Cody code completions is currently [untested and
unsupported](https://sourcegraph.slack.com/archives/CN4FC7XT4/p1690986792111129?thread_ts=1690931810.610299&cid=CN4FC7XT4).
Despite this, we have [at least one customer generating very large
numbers of OpenAI code completions
requests](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1691438665847449?thread_ts=1689373762.522179&cid=C03JR7S7KRP)
- enough to get us [rate limited by
OpenAI](https://sourcegraph.sentry.io/issues/4372449189/?alert_rule_id=14416305&alert_type=issue&project=4505201451270144).

This change:

- Makes Cody Gateway reject OpenAI code completions requests (responding
with 501 not implemented)
- Prevents Sourcegraph from generating OpenAI code completion requests

CI

---------

Co-authored-by: Erik Seliger <erikseliger@me.com>
(cherry picked from commit 151f43f)
bobheadxi added a commit that referenced this pull request Aug 9, 2023
…r OpenAI (#55624) (#55689)

Backport of #55624, created manually

---

Using OpenAI for Cody code completions is currently [untested and
unsupported](https://sourcegraph.slack.com/archives/CN4FC7XT4/p1690986792111129?thread_ts=1690931810.610299&cid=CN4FC7XT4).
Despite this, we have [at least one customer generating very large
numbers of OpenAI code completions

requests](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1691438665847449?thread_ts=1689373762.522179&cid=C03JR7S7KRP)
- enough to get us [rate limited by
OpenAI](https://sourcegraph.sentry.io/issues/4372449189/?alert_rule_id=14416305&alert_type=issue&project=4505201451270144).

This change:

- Makes Cody Gateway reject OpenAI code completions requests (responding
with 501 not implemented)
- Prevents Sourcegraph from generating OpenAI code completion requests

CI

---------

Co-authored-by: Erik Seliger <erikseliger@me.com>
(cherry picked from commit 151f43f)



## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
davejrt pushed a commit that referenced this pull request Aug 9, 2023
Using OpenAI for Cody code completions is currently [untested and
unsupported](https://sourcegraph.slack.com/archives/CN4FC7XT4/p1690986792111129?thread_ts=1690931810.610299&cid=CN4FC7XT4).
Despite this, we have [at least one customer generating very large
numbers of OpenAI code completions
requests](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1691438665847449?thread_ts=1689373762.522179&cid=C03JR7S7KRP)
- enough to get us [rate limited by
OpenAI](https://sourcegraph.sentry.io/issues/4372449189/?alert_rule_id=14416305&alert_type=issue&project=4505201451270144).

This change:

- Makes Cody Gateway reject OpenAI code completions requests (responding
with 501 not implemented)
- Prevents Sourcegraph from generating OpenAI code completion requests

## Test plan

CI

---------

Co-authored-by: Erik Seliger <erikseliger@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backports cla-signed release-blocker Prevents us from releasing: https://about.sourcegraph.com/handbook/engineering/releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants