Skip to content

Commit c516632

Browse files
committed
fix: print full s11 continuation output
1 parent 06ac34e commit c516632

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

s11_error_recovery/code.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,14 @@ def agent_loop(messages: list, context: dict):
352352
break
353353
if query.strip().lower() in ("q", "exit", ""):
354354
break
355+
turn_start = len(history)
355356
history.append({"role": "user", "content": query})
356357
agent_loop(history, context)
357358
context = update_context(context, history)
358-
for block in history[-1]["content"]:
359-
if getattr(block, "type", None) == "text":
360-
print(block.text)
359+
for msg in history[turn_start:]:
360+
if msg.get("role") != "assistant":
361+
continue
362+
for block in msg["content"]:
363+
if getattr(block, "type", None) == "text":
364+
print(block.text)
361365
print()

0 commit comments

Comments
 (0)