mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-08-07 12:33:46 +08:00
Merge pull request #362 from Panda-eyes123/fix
fix: show error messages when API exceptions occur in s12-s20
This commit is contained in:
@@ -373,4 +373,6 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.text)
|
print(block.text)
|
||||||
|
elif isinstance(block, dict) and block.get("type") == "text":
|
||||||
|
print(block.get("text", ""))
|
||||||
print()
|
print()
|
||||||
|
|||||||
@@ -475,4 +475,6 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.text)
|
print(block.text)
|
||||||
|
elif isinstance(block, dict) and block.get("type") == "text":
|
||||||
|
print(block.get("text", ""))
|
||||||
print()
|
print()
|
||||||
|
|||||||
@@ -973,6 +973,8 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.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.
|
# Announce once when every teammate has finished and its output drained.
|
||||||
if active_teammates:
|
if active_teammates:
|
||||||
|
|||||||
@@ -868,6 +868,8 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.text)
|
print(block.text)
|
||||||
|
elif isinstance(block, dict) and block.get("type") == "text":
|
||||||
|
print(block.get("text", ""))
|
||||||
|
|
||||||
# Check inbox → route protocol + inject into history
|
# Check inbox → route protocol + inject into history
|
||||||
inbox_msgs = consume_lead_inbox(route_protocol=True)
|
inbox_msgs = consume_lead_inbox(route_protocol=True)
|
||||||
|
|||||||
@@ -799,6 +799,8 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.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
|
# Consume lead inbox: route protocol + inject into history
|
||||||
inbox = consume_lead_inbox(route_protocol=True)
|
inbox = consume_lead_inbox(route_protocol=True)
|
||||||
|
|||||||
@@ -984,6 +984,8 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.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
|
# Consume lead inbox: route protocol + inject into history
|
||||||
inbox = consume_lead_inbox(route_protocol=True)
|
inbox = consume_lead_inbox(route_protocol=True)
|
||||||
|
|||||||
@@ -1013,6 +1013,8 @@ if __name__ == "__main__":
|
|||||||
for block in history[-1]["content"]:
|
for block in history[-1]["content"]:
|
||||||
if getattr(block, "type", None) == "text":
|
if getattr(block, "type", None) == "text":
|
||||||
print(block.text)
|
print(block.text)
|
||||||
|
elif isinstance(block, dict) and block.get("type") == "text":
|
||||||
|
print(block.get("text", ""))
|
||||||
|
|
||||||
inbox = consume_lead_inbox(route_protocol=True)
|
inbox = consume_lead_inbox(route_protocol=True)
|
||||||
if inbox:
|
if inbox:
|
||||||
|
|||||||
@@ -2063,8 +2063,8 @@ def print_turn_assistants(messages: list, turn_start: int):
|
|||||||
if msg.get("role") != "assistant":
|
if msg.get("role") != "assistant":
|
||||||
continue
|
continue
|
||||||
for block in msg.get("content", []):
|
for block in msg.get("content", []):
|
||||||
if getattr(block, "type", None) == "text":
|
if block_type(block) == "text":
|
||||||
terminal_print(block.text)
|
terminal_print(block["text"] if isinstance(block, dict) else block.text)
|
||||||
|
|
||||||
|
|
||||||
def cron_autorun_loop(history: list, context: dict):
|
def cron_autorun_loop(history: list, context: dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user