Skip to content

Commit 9413d39

Browse files
committed
Uniquely identify tool call responses since models can duplicate them and it messes up the agent when they do
1 parent 47bbe77 commit 9413d39

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

cecli/coders/base_coder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,6 +2404,7 @@ async def process_tool_calls(self, tool_call_response):
24042404
ConversationManager.add_message(
24052405
message_dict=tool_response,
24062406
tag=MessageTag.CUR,
2407+
hash_key=(tool_response["tool_call_id"], str(time.monotonic_ns())),
24072408
)
24082409

24092410
return True

cecli/helpers/conversation/integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def add_file_list_reminder(cls, coder) -> None:
161161
},
162162
tag=MessageTag.REMINDER,
163163
priority=275, # Between post_message blocks and final reminders
164-
hash_key=("file_list_reminder",), # Unique hash_key to avoid conflicts
164+
hash_key=("reminder", "file_list"), # Unique hash_key to avoid conflicts
165165
mark_for_delete=0, # Lasts for exactly one turn
166166
)
167167

0 commit comments

Comments
 (0)