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.53k stars 261 forks source link

show commands & Prompt Library together #5105

Closed sqs closed 1 month ago

sqs commented 1 month ago

Related project: https://linear.app/sourcegraph/project/transition-commands-to-prompt-library-71cbc0dfef6b/overview

Because we need to support customers on self-hosted Sourcegraph releases that have not yet upgraded to the upcoming release with the Prompt Library, we need to show prompts and commands (builtin and custom) together for at least another month.

Loom video walkthrough

image

Related TODOs (not blocking merging this):

Test plan

Changelog

jamesmcnamara commented 1 month ago

Pre-tagging myself on this because I'm looking into hiding commands for Eclipse where certain things aren't supported and this touches a lot of the same code.

olafurpg commented 1 month ago

Following the test plan:

Subjective opinions about unification of prompts and commands:

Non-blocking notes on Prompts as a feature after playing around with this, unrelated to this PR. I can share this separately in #feedback-product if you think it's useful:

olafurpg commented 1 month ago

The very first time I ran this I briefly ran into an issue where I only saw my local Ollama models, and none of the edit/document/test commands worked. The issue immediately went away when I reloaded my VS Code, and I haven't been able to replicate/see any obvious reason why this would happen. Just mentioning it in case you're aware of this or have any idea what could have caused this

I ran the "Restart Extension Host" command every time I switched accounts. I've reported issues in the past about UI chat bugs when switching between accounts (which are fixed with "Restart Extension Host"). I've considered these low-priority issues because most users presumably don't switch regularly between accounts.

sqs commented 1 month ago

Thanks for the feedback and reviews! Will merge this and address the top feedback items in the next couple hours.

The very first time I ran this I briefly ran into an issue where I only saw my local Ollama models, and none of the edit/document/test commands worked. The issue immediately went away when I reloaded my VS Code, and I haven't been able to replicate/see any obvious reason why this would happen. Just mentioning it in case you're aware of this or have any idea what could have caused this

I ran the "Restart Extension Host" command every time I switched accounts. I've reported issues in the past about UI chat bugs when switching between accounts (which are fixed with "Restart Extension Host"). I've considered these low-priority issues because most users presumably don't switch regularly between accounts.

It is now much easier to fix this with https://github.com/sourcegraph/cody/pull/5083, because the webview can now "observe" values in the extension host. Only a few things have been ported over to use this yet, though.