We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06ac34e commit c516632Copy full SHA for c516632
1 file changed
s11_error_recovery/code.py
@@ -352,10 +352,14 @@ def agent_loop(messages: list, context: dict):
352
break
353
if query.strip().lower() in ("q", "exit", ""):
354
355
+ turn_start = len(history)
356
history.append({"role": "user", "content": query})
357
agent_loop(history, context)
358
context = update_context(context, history)
- for block in history[-1]["content"]:
359
- if getattr(block, "type", None) == "text":
360
- print(block.text)
+ for msg in history[turn_start:]:
+ if msg.get("role") != "assistant":
361
+ continue
362
+ for block in msg["content"]:
363
+ if getattr(block, "type", None) == "text":
364
+ print(block.text)
365
print()
0 commit comments