microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.64k stars 29.04k forks source link

Add the ability to reopen chat stream after successful response #211136

Open robconery opened 6 months ago

robconery commented 6 months ago

I have been working with @isidorn on a chat extension and I'm finding that I need to re-open the chat stream so I can update the user on the results of their message.

For instance: the user asks Copilot for help on a topic. I'm augmenting the prompt and sending. When I receive the reply, I'm extracting code that I then execute, but only after the user clicks a button that I output to the chat window, which explicitly says "Run This". I want to report back the results of execution, but currently the only way I can do that is via popups, which is out of the flow of the chat.

Ideally, I could re-open the chat stream so I can send the results and also add a stream.progress when the execution goes off (or show an error if there was one). The follow up provider doesn't quite fit the scenario as the process is a bit more interactive.

isidorn commented 6 months ago

So the ask is to be able to report progress in the chat even when not in the process of responding to the prompt. Do we have some alternative suggestion how extension authors can achieve this?

fyi @roblourens

jrieken commented 6 months ago

Understood and supportive. I believe re-opening isn't the best way to achieve this because it being closed marks the end of this reply. What we have been considering is some kind of "continuation button" that doesn't run a vscode.Command-command but appends and submits another message to the current chat. That would allow a participant to reply to "itself"

roblourens commented 5 months ago

Agreed, and we'd like to have real API/UX for this but you could get a similar effect today by calling back to yourself with executeCommand('workbench.action.chat.open', { query: ... })

cjlapao commented 4 months ago

I would also like something similar to this. In our example, we might have a long-running execution, or we might need to ask if the user wants to execute something else in the same context. Currently, we are achieving the same thing with dialogs being sent to the user, but that seems to disrupt the flow of the chat.