Open bpasero opened 1 month ago
I rely on IChatWidgetService.getWidgetBySessionId() to be able to
Don't do that. It is realistic that one model is attached to multiple widgets - that's for inline chat but also for chat editors
I see. Then I will need another way of finding the chat widget for a response. I only have a ChatResponseViewModel
in hand:
I believe chatWidgetService.lastFocusedWidget
is the best way to achieve that. Using the response
argument is already fishy because it won't be set when users invoke your command from a keybinding.
Yeah I will go with that 👍
This maybe related to https://github.com/microsoft/vscode/issues/212780.
For the support for text-to-speech from a response, I rely on
IChatWidgetService.getWidgetBySessionId()
to be able to control the lifecycle of the session in the context of the chat. This works fine in most chat locations, but not in inline and I wonder if its related to inline having 2 modes ("lightweight" and "heavy"). I get back a widget that is not the focused chat widget in the following scenario:Steps:
Helpful
action here to make some changes to demonstrate the problemHelpful
actionNotice how the widget returned from
getWidgetBySessionId
is not the same aslastFocusedWidget
. I think the widget associated with the session ID is still the "lightweight" variant?