-
Couldn't load subscription status.
- Fork 35.8k
Ability to close a contributed chat session #273639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the ability to dispose contributed Copilot chat sessions by invoking an optional close method when a session is being disposed.
Key Changes
- Added a call to
close()method (if available) during chat session disposal
| /** | ||
| * Implement to handle when the Chat Session is closed. | ||
| */ | ||
| close?(): void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going with something similar to CustomDocument & PseudoTerminal
Didn't know whether to go with close or dispose
Went with close as that feels the right terminology for chat sessions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more info about the use case? A close method isn't a great fit for the current api design but maybe we can come up with something better
|
@mjbvz Sure.
When creating a chat editor, we call the get content API. which in turn creates corresponding CLI session object. Basically each chat editor has a corresponding session object in extension. When these editors are closed extension has no way of knowing that they're closed. Optionally an event |
|
Thanks. Are there resource tied to having a session opened in an editor, or are they tied to the chat session item existing? If possible, can you link them to the chat session items? That's what we intended for managing the lifecycle of sessions, while the content provider just provides the initial content for a chat session |
Yes. when we open a chat in the editor, then we need to use a separate API that constructs the chat object via the SDK & this uses some resources & requires proper teardown.
Not sure what you mean.
Unfortunately this isn't an efficient approach for Copilot CLI Also please note when opening a single session in session editor, the contributed
From what I understand the content is required only when opening a chat editor. |
|
What does the chat object do? Is it something like an event listen that gets updates from a server? |
|
The SDK object has event listeners and writes to the session files. On top of this, we have a delete icon in the chat sessions view that allows one to delete a chat session. Ideally we'd like to either disabled this icon of the chat is opened or closed the chat editor. Perhaps list of opened chat editors and closed event could work here. |
Ability to dispose the contributed copilot chat sessions.
For #270852
For https://github.com/microsoft/vscode-internalbacklog/issues/5982