sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.55k stars 265 forks source link

observe config changes in AuthProvider #5221

Open sqs opened 1 month ago

sqs commented 1 month ago

The goal is to make Cody respond to config and auth changes better, so that no full-editor-reloads are required, and it reacts instantly to connectivity loss and reestablishment. This PR is one of many related ones, and this particular one makes it so that the AuthProvider listens to config changes more reactively. It's still not totally reactive; sometimes AuthProvider.auth still is called. But it gets us closer.

Helps with https://linear.app/sourcegraph/issue/CODY-3332/full-native-offline-mode-and-instant-config-reactivity-for-cody-in-vs.

See https://sourcegraph.slack.com/archives/C05AGQYD528/p1723791822404399.

Test plan

e2e tests

github-actions[bot] commented 3 weeks ago

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

Manouchehri commented 1 week ago

What will the isOfflineMode flag be in VS Code? Super excited to try this out. :)

sqs commented 1 week ago

@Manouchehri We already have offline mode, but this (or a future PR) will support an ephemeral offline mode that is a bit smoother. Not a big new feature or anything, just something that makes it handle network connectivity issues better.