@@ -18,6 +18,7 @@ class ConversationChunks:
1818 def __init__ (self , coder ):
1919 self .coder = weakref .ref (coder )
2020 self .uuid = coder .uuid
21+ self ._last_clear_count = 0
2122
2223 @classmethod
2324 def get_instance (cls , coder ) -> "ConversationChunks" :
@@ -212,7 +213,11 @@ def cleanup_files(self) -> None:
212213 if diff_count > 0 and other_count > 0 and diff_count / other_count > 20 :
213214 should_clear = True
214215
215- if should_clear :
216+ self ._last_clear_count += 1
217+
218+ if should_clear and self ._last_clear_count >= 10 :
219+ self ._last_clear_count = 0
220+
216221 # Clear all diff messages
217222 ConversationService .get_manager (coder ).clear_tag (MessageTag .DIFFS )
218223 ConversationService .get_manager (coder ).clear_tag (MessageTag .FILE_CONTEXTS )
@@ -587,7 +592,7 @@ def add_readonly_files_messages(self) -> List[Dict[str, Any]]:
587592 # Add assistant message with file path as hash_key
588593 assistant_msg = {
589594 "role" : "assistant" ,
590- "content" : "I understand, thank you for sharing the file contents." ,
595+ "content" : f"Thank you for sharing the file contents for { rel_fname } ." ,
591596 }
592597 ConversationService .get_manager (coder ).add_message (
593598 message_dict = assistant_msg ,
@@ -687,7 +692,7 @@ def add_chat_files_messages(self) -> Dict[str, Any]:
687692 # Create assistant message
688693 assistant_msg = {
689694 "role" : "assistant" ,
690- "content" : "I understand, thank you for sharing the file contents." ,
695+ "content" : f"Thank you for sharing the file contents for { rel_fname } ." ,
691696 }
692697
693698 # Determine tag based on editability
@@ -777,7 +782,7 @@ def add_file_context_messages(self, promote_messages=True) -> None:
777782
778783 assistant_msg = {
779784 "role" : "assistant" ,
780- "content" : "I understand, thank you for sharing the prefixed file contents." ,
785+ "content" : f"Thank you for sharing the prefixed file contents for { rel_fname } ." ,
781786 }
782787
783788 # Add to conversation manager
@@ -786,13 +791,15 @@ def add_file_context_messages(self, promote_messages=True) -> None:
786791 tag = MessageTag .FILE_CONTEXTS ,
787792 hash_key = ("file_context_user" , file_path ),
788793 force = True ,
794+ update_timestamp = False ,
789795 )
790796
791797 ConversationService .get_manager (coder ).queue_message (
792798 message_dict = assistant_msg ,
793799 tag = MessageTag .FILE_CONTEXTS ,
794800 hash_key = ("file_context_assistant" , file_path ),
795801 force = True ,
802+ update_timestamp = False ,
796803 )
797804
798805 def reset (self ) -> None :
0 commit comments