+28
-1
bsky.py
+28
-1
bsky.py
···
588
# Indent response text
589
for line in chunk.content.split('\n'):
590
print(f" {line}")
591
else:
592
# Filter out verbose message types
593
if chunk.message_type not in ['usage_statistics', 'stop_reason']:
···
1615
print(" โโโโโโโโโโโโโโโโโโ")
1616
for line in chunk.content.split('\n'):
1617
print(f" {line}")
1618
-
1619
if str(chunk) == 'done':
1620
break
1621
···
588
# Indent response text
589
for line in chunk.content.split('\n'):
590
print(f" {line}")
591
+
elif chunk.message_type == 'error_message':
592
+
# Extract all available error info
593
+
error_details = []
594
+
for attr in ['content', 'message', 'error', 'reason', 'details', 'run_id', 'step_id']:
595
+
val = getattr(chunk, attr, None)
596
+
if val:
597
+
error_details.append(f"{attr}={val}")
598
+
if error_details:
599
+
logger.error(f"Agent error: {', '.join(error_details)}")
600
+
else:
601
+
# Dump all non-None attributes
602
+
all_attrs = {k: v for k, v in vars(chunk).items() if v is not None and not k.startswith('_')}
603
+
logger.error(f"Agent error (raw): {all_attrs}")
604
+
# Also log full object at debug level
605
+
logger.debug(f"Full error_message: {chunk}")
606
else:
607
# Filter out verbose message types
608
if chunk.message_type not in ['usage_statistics', 'stop_reason']:
···
1630
print(" โโโโโโโโโโโโโโโโโโ")
1631
for line in chunk.content.split('\n'):
1632
print(f" {line}")
1633
+
elif chunk.message_type == 'error_message':
1634
+
# Extract all available error info
1635
+
error_details = []
1636
+
for attr in ['content', 'message', 'error', 'reason', 'details', 'run_id', 'step_id']:
1637
+
val = getattr(chunk, attr, None)
1638
+
if val:
1639
+
error_details.append(f"{attr}={val}")
1640
+
if error_details:
1641
+
logger.error(f"Synthesis error: {', '.join(error_details)}")
1642
+
else:
1643
+
all_attrs = {k: v for k, v in vars(chunk).items() if v is not None and not k.startswith('_')}
1644
+
logger.error(f"Synthesis error (raw): {all_attrs}")
1645
+
1646
if str(chunk) == 'done':
1647
break
1648