We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e40f4b5 + 36e2e38 commit b01c7d2Copy full SHA for b01c7d2
1 file changed
agentmesh/protocol/agent_stream.py
@@ -88,6 +88,11 @@ def run_stream(self, user_message: str) -> str:
88
89
final_response = ""
90
turn = 0
91
+
92
+ # Safety check: ensure max_turns is valid
93
+ if self.max_turns is None:
94
+ logger.warning("max_turns is None, using default value 10")
95
+ self.max_turns = 10
96
97
try:
98
while turn < self.max_turns:
@@ -159,7 +164,9 @@ def run_stream(self, user_message: str) -> str:
159
164
logger.warning(f"Reached max turns: {self.max_turns}")
160
165
161
166
except Exception as e:
167
+ import traceback
162
168
logger.error(f"Agent execution error: {e}")
169
+ logger.error(f"Full traceback:\n{traceback.format_exc()}")
163
170
self._emit_event("error", {"error": str(e)})
171
raise
172
0 commit comments