@@ -320,26 +320,26 @@ def update_status_bar_text(self, extra_variables: dict[str, Any] | None = None)
320320
321321 def on_server_notification_async (self , notification : Notification ) -> None :
322322 if notification .method == "$/progress" :
323- if (token := notification . params [ "token" ]) and token . startswith ( "copilot_chat://" ):
324- if params := notification .params ["value" ]:
325- if not ( window := WindowConversationManager . find_window_by_token_id ( token )):
326- return
327-
328- wcm = WindowConversationManager (window )
329- if params .get ("kind" , None ) == "end" :
330- wcm .is_waiting = False
323+ if (
324+ ( token := notification .params ["token" ]). startswith ( "copilot_chat://" )
325+ and ( params := notification . params [ "value" ])
326+ and ( window := WindowConversationManager . find_window_by_token_id ( token ))
327+ ):
328+ wcm = WindowConversationManager (window )
329+ if params .get ("kind" , None ) == "end" :
330+ wcm .is_waiting = False
331331
332- if suggest_title := params .get ("suggestedTitle" , None ):
333- wcm .suggested_title = suggest_title
332+ if suggest_title := params .get ("suggestedTitle" , None ):
333+ wcm .suggested_title = suggest_title
334334
335- if params .get ("reply" , None ):
336- wcm .append_conversation_entry (params )
335+ if params .get ("reply" , None ):
336+ wcm .append_conversation_entry (params )
337337
338- if followup := params .get ("followUp" , None ):
339- message = followup .get ("message" , "" )
340- wcm .follow_up = message
338+ if followup := params .get ("followUp" , None ):
339+ message = followup .get ("message" , "" )
340+ wcm .follow_up = message
341341
342- wcm .update ()
342+ wcm .update ()
343343
344344 @notification_handler (NTFY_FEATURE_FLAGS_NOTIFICATION )
345345 def _handle_feature_flags_notification (self , payload : CopilotPayloadFeatureFlagsNotification ) -> None :
0 commit comments