a digital person for bluesky

Dump full error_message objects for better debugging

Print entire error chunk plus model_dump()/vars() to capture
all fields regardless of what Letta returns.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+12 -25
+12 -25
bsky.py
··· 589 589 for line in chunk.content.split('\n'): 590 590 print(f" {line}") 591 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}") 592 + # Dump full error object 593 + logger.error(f"Agent error_message: {chunk}") 594 + if hasattr(chunk, 'model_dump'): 595 + logger.error(f"Agent error (dict): {chunk.model_dump()}") 596 + elif hasattr(chunk, '__dict__'): 597 + logger.error(f"Agent error (vars): {vars(chunk)}") 606 598 else: 607 599 # Filter out verbose message types 608 600 if chunk.message_type not in ['usage_statistics', 'stop_reason']: ··· 1631 1623 for line in chunk.content.split('\n'): 1632 1624 print(f" {line}") 1633 1625 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}") 1626 + # Dump full error object 1627 + logger.error(f"Synthesis error_message: {chunk}") 1628 + if hasattr(chunk, 'model_dump'): 1629 + logger.error(f"Synthesis error (dict): {chunk.model_dump()}") 1630 + elif hasattr(chunk, '__dict__'): 1631 + logger.error(f"Synthesis error (vars): {vars(chunk)}") 1645 1632 1646 1633 if str(chunk) == 'done': 1647 1634 break