vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

Option to attach no context in chat

Open omltcat opened this issue 1 year ago • 1 comments

A while back, Copilot Chat experimented with requiring user to specifically select part of the code, or using # to denote a context in chat. If the user does not do either, copilot would only use the user's question and previous chat as context and nothing more. This was documented here.

For some reason, this was discontinued, and chat will now automatically use current viewable code as context. But this leads to quite more unpredictable behavior than before.

Two major undesirable behaviors I have observed so far:

  • When the user wants to ask a generic coding question, but copilot have no way of knowing so. It might try to answer in the context of the editor code, even though the code may or my not even be related to the question.
  • When the user wants to ask a follow up question to copilot's previous chat response, copilot might prioritize the editor code as context, instead of its own previous response. So instead of refining its previous response, copilot could generates an entirely new response about the editor code.

A hacky way I found to try to get around this problem is intentionally selecting a blank piece of code before asking in chat, in the hope that if it sees no code, it will just focus on exchanges in the chat window. It does not always works however. Sometime copilot will simply complain that it has no context (even in the presence of previous messages) and can't generate an answer.

Since now we have a button to specifically attach context, can we have one more option in that button to attach "no context"? The hope is to reliably direct copilot's attention to just the chat question and previous chat exchanges (if any).

Thanks

omltcat avatar Jul 27 '24 00:07 omltcat

"No code selected" should not give any context in my opinion.

It is wasteful to force to give a context, especially based on the viewed lines, which also ends up in pretty bad results.

guillaume-mueller avatar Jul 31 '24 13:07 guillaume-mueller

Tracking in https://github.com/microsoft/vscode-copilot-release/issues/675

roblourens avatar Aug 23 '24 16:08 roblourens

Tracking in #675

#675 is marked as completed, and so is this one. Is this still on the roadmap? Or was it implemented and I somehow missed it?

Count me as another user who is bothered by the current behavior. Many times I just want to use Copilot for documentation or general knowledge, and it insists in using the current file in the context. I'm having to use a separate browser window with Gemini/ChatGPT, which defeats the point of having Copilot integrated with VS Code.

In my mind giving user direct control to indicate if / when to include code as context would be preferable (either by selection, or explicitly by using tags in the chat - e.g. #file). Alternatively, you could have an option in User Settings to either enable (i.e., always include file), disable (never include file), or automatic (i.e., try to infer when to use, which is the current implementation).

guiambros avatar Aug 26 '24 00:08 guiambros

Image

roblourens avatar Aug 26 '24 01:08 roblourens

Duh, I looked at the closed items at the bottom (which was for this one), instead of the issue itself.

Apologies for the irrelevant bump.

guiambros avatar Aug 26 '24 01:08 guiambros