vscode-copilot-release
vscode-copilot-release copied to clipboard
Let the user decide whether to include the current selection as context
The current editor selection is included by default for some chat commands. It should be obvious in the UI that this is going to happen, and the user should have a chance to uncheck/remove the chat context before sending their request.
This could either just say that the "current editor selection" is included, or it could display the exact file + range. And I'm imagining a checkbox that the user can use to enable/disable this piece of context. We should be able to extend this to cover other types of context in the future
Some questions-
- Is this driven by vscode core, or totally by extension API?
- How does an agent/slash command determine which context types it wants to use by default?
- How does this work with intent detection?
- This question makes me think that this can't be per-agent at all, it has to be a global thing that vscode runs. That is ok, and probably easier. This UX can determine whether this context is sent to the agent, but it's still the agent's decision whether/how to use that context, or ignore it.
Since users need to add scope with @workspace
and /file
. It would be consistent to always need them to insert /selection into the prompt as well?
We can automate /selection insertion though. So when you select lines in the editor and then focus on the prompt, /selection
will automatically be inserted.
Current thinking:
Since I don't want to add UI that might not work with automatic intent detection that we would invest in at some point in the future, I am looking at simpler ways to fix the annoyance.
Currently we include either the current selection or the code in the viewport of the active editor, if there is no selection. We should skip the second part, only include an explicit selection if it's available, and make it easy to use variables to fill in the rest. We will probably roll this out as an experiment. This month.
- add an experiment to not include the viewport selection by default
- Add a
#currentEditor
variable (maybe there's a better name) - Maybe add a
#file
variable that shows up for the current file - Think about variable discoverability in general
https://github.com/microsoft/vscode-copilot/pull/3620
There is now an experiment running at 50/50 to disable the implicit editor context.
Now it seems that it does not check reference at all even when i do @workspace
Please open a separate issue for that with an example, thanks
Going back to the concept of showing the pieces of context as UI in a sort of "status bar" under the chat input box. We need
- each agent/command to be able to declare which pieces of context it will take implicitly
- to render these as controls with a checkbox
- How can we enable the user to preview the value too?
- VS Code to tell the agent which of these were enabled/disabled when the request is made
API could look like this
export interface ChatAgent2<TResult extends ChatAgentResult2> {
...
/**
* A list of variable names that this agent will look at by default. They will be rendered as toggleable controls beneath the chat input.
*/
contextKinds?: string[];
}
export interface ChatAgentRequest {
...
/**
* Variables that were enabled by the user in the UI will be included in this set, but will not appear in the query.
* OR, they could be appended to the end of the query
*/
variables: Record<string, ChatVariableValue[]>;
}
So this is saying that they have to be variables, the agent (or slash command) just declares a list of them, and the enabled ones are resolved and passed to the request pretty much as usual.
Mmmm yo soy de los que ya no le sale la referencia de archivo y en lo personal la prefiero porque ahora cada vez que le pregunto de mi proyecto o algunas funciones, me contesta de manera erronea porque no tiene el contexto.
Maybe I have the wrong end of the stick here, but rather than it saying: "As an AI, I don't have access to your files or environment..." could it maybe have something a bit more helpful, like: "You didn't include any file content in your request. If you wish to include a file, you could use #editor to include the file currently open in the editor or #file to include any file from your workspace. See [link] for more information about available options."
Hello, I want to chat with CoPilot about things that are unrelated to the open file, but it is always including the open file as context, and it keeps getting confused. Like I was chatting about shell scripts while having a Go file open. Then it responds "In the Go code you shared..." I'm NOT choosing to share the Go code. It's just getting automatically picked up.
How do I turn off automatic context inclusion and manually decide to include or not include? In another tool I used before, there were two options "Send" (without context) and "Send With Context". I need similar options in Copilot.
My current workaround is to close all open files. NOT ideal.
Kudos to that issue, find it clearly not ideal to have to close all files each time asking a general question
If fixed, it would truly make Copilot an equivalent to ChatGPT within VScode