Merge pull request #362 from Panda-eyes123/fix

fix: show error messages when API exceptions occur in s12-s20
This commit is contained in:
Yang Haoran
2026-06-27 01:55:39 +08:00
committed by GitHub
8 changed files with 16 additions and 2 deletions

View File

@@ -373,4 +373,6 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
print()

View File

@@ -475,4 +475,6 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
print()

View File

@@ -973,6 +973,8 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
# Announce once when every teammate has finished and its output drained.
if active_teammates:

View File

@@ -868,6 +868,8 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
# Check inbox → route protocol + inject into history
inbox_msgs = consume_lead_inbox(route_protocol=True)

View File

@@ -799,6 +799,8 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
# Consume lead inbox: route protocol + inject into history
inbox = consume_lead_inbox(route_protocol=True)

View File

@@ -984,6 +984,8 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
# Consume lead inbox: route protocol + inject into history
inbox = consume_lead_inbox(route_protocol=True)

View File

@@ -1013,6 +1013,8 @@ if __name__ == "__main__":
for block in history[-1]["content"]:
if getattr(block, "type", None) == "text":
print(block.text)
elif isinstance(block, dict) and block.get("type") == "text":
print(block.get("text", ""))
inbox = consume_lead_inbox(route_protocol=True)
if inbox:

View File

@@ -2063,8 +2063,8 @@ def print_turn_assistants(messages: list, turn_start: int):
if msg.get("role") != "assistant":
continue
for block in msg.get("content", []):
if getattr(block, "type", None) == "text":
terminal_print(block.text)
if block_type(block) == "text":
terminal_print(block["text"] if isinstance(block, dict) else block.text)
def cron_autorun_loop(history: list, context: dict):