forked from Doriandarko/claude-engineer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.memory
138 lines (138 loc) · 6.14 KB
/
.memory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
{
"conversations": [
{
"date": "2025-01-20",
"topic": "Tool Results Handling Bug",
"issue": {
"description": "Tool results being incorrectly added as user messages in conversation history",
"symptoms": [
"at least one message is required error",
"conversation context being lost during tool usage",
"user input being overwritten by tool results"
],
"root_cause": "Tool results were being added to conversation history with 'user' role, interfering with the original user context"
},
"solution": {
"changes": [
"Added special 'tool_result' role for tool outputs",
"Added filtering in conversation history processing to skip tool results when sending to API",
"Maintained original user context throughout tool usage chain"
],
"code_changes": {
"location": "ce3.py/_get_completion method",
"key_modifications": [
{
"old": "self.conversation_history.append({'role': 'user', 'content': tool_results_str})",
"new": "self.conversation_history.append({'role': 'tool_result', 'content': tool_results})"
},
{
"added": "if msg.get('role') == 'tool_result': continue # Skip tool results when processing history"
}
]
}
},
"related_files": [
"ce3.py",
"memory_manager.py"
],
"keywords": [
"tool_results",
"conversation_history",
"user_input",
"message_required",
"context_preservation",
"tool_chaining"
]
},
{
"date": "2025-01-20",
"topic": "FileContentReaderTool Double Execution Bug",
"issue": {
"description": "FileContentReaderTool executing twice and returning empty content",
"symptoms": [
"Tool executing twice for same file request",
"Empty content being returned {'ce3.py': ''}",
"Unnecessary API calls and processing overhead"
],
"root_cause": "Tool was returning JSON strings instead of Python dictionaries, causing the tool execution system to mishandle the response and trigger a second execution"
},
"solution": {
"changes": [
"Modified execute method to return Python dictionaries directly",
"Removed JSON serialization from tool (letting tool execution system handle it)",
"Updated return type annotations for clarity"
],
"code_changes": {
"location": "tools/filecontentreadertool.py",
"key_modifications": [
{
"old": "return json.dumps(results, indent=2)",
"new": "return results"
},
{
"old": "return json.dumps({\"error\": str(e)}, indent=2)",
"new": "return {\"error\": str(e)}"
},
{
"added": "def execute(self, **kwargs) -> dict: # Changed return type annotation"
}
]
}
},
"related_files": [
"tools/filecontentreadertool.py"
],
"keywords": [
"tool_results",
"file_reading",
"json_serialization",
"tool_execution",
"error_handling"
]
},
{
"date": "2025-01-20",
"topic": "Tool Execution Infinite Loop Bug",
"issue": {
"description": "Tool execution entering infinite loop with repeated executions",
"symptoms": [
"Tool executing repeatedly without stopping",
"Conversation getting stuck in tool execution loop",
"Excessive API calls and system resource usage"
],
"root_cause": "Improper handling of tool results in conversation flow causing continuous recursion in _get_completion method"
},
"solution": {
"changes": [
"Modified tool result handling in conversation flow",
"Added check for actual tool results before continuing conversation",
"Improved tool result structure consistency",
"Added safeguard against empty tool results"
],
"code_changes": {
"location": "ce3.py/_get_completion method",
"key_modifications": [
{
"old": "self.conversation_history.append({\"role\": \"tool_result\", \"content\": tool_results})",
"new": "if tool_results: # Only add tool results if we have any\n self.conversation_history.append({\"role\": \"tool_result\", \"content\": tool_results})"
},
{
"old": "return self._get_completion()",
"new": "if tool_results: # Continue only if we have tool results\n return self._get_completion()\nelse:\n return \"No tool results available.\""
}
]
}
},
"related_files": [
"ce3.py"
],
"keywords": [
"tool_execution",
"infinite_loop",
"recursion",
"conversation_flow",
"error_handling"
]
}
]
}