File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919import requests
2020import webview
2121from sensai .util import logging
22+ from sensai .util .helper import mark_used
2223from sensai .util .logging import LogTime
2324from sensai .util .string import dict_string
2425
@@ -279,7 +280,17 @@ def get_modes_with_prompts_to_be_provided_for_project_activation(self, session_i
279280 :return: the modes
280281 """
281282 result = []
282- if not self ._get_session_status (session_id ).mode_prompts_provided :
283+
284+ # Note: We always want to provide the prompts of newly activated modes in the activation message
285+ # because some clients (e.g. Claude Desktop) use a single session for all chats.
286+ # Therefore, we view project activation as an "entry action", which must always provide
287+ # all the information that is relevant to the project
288+ # Because of this, we cannot use a condition like this:
289+ # new_mode_prompts_must_be_provided_for_activation = not self._get_session_status(session_id).mode_prompts_provided
290+ new_mode_prompts_must_be_provided_for_activation = True
291+ mark_used (session_id )
292+
293+ if new_mode_prompts_must_be_provided_for_activation :
283294 for mode_name in self ._newly_activated_mode_names :
284295 mode = ActiveModes .get_mode_instance (mode_name )
285296 if mode .has_prompt ():
You can’t perform that action at this time.
0 commit comments