this repo has no description
40
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add detailed logging for tool call status tracking

Adds comprehensive debug logging to track tool call/return message processing:
- Logs all message attributes (type, tool_call_id, status, name)
- Shows which tool results are collected in first pass
- Displays available tool_call_results when processing add_post_to_bluesky_reply_thread calls
- Helps diagnose "unknown status" warnings when tool returns are missing

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

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

+24 -5
+24 -5
bsky.py
··· 657 657 ignored_notification = False 658 658 ignore_reason = "" 659 659 ignore_category = "" 660 - 660 + 661 + logger.debug(f"Processing {len(message_response.messages)} messages from agent") 662 + 661 663 for message in message_response.messages: 662 - if hasattr(message, 'tool_call_id') and hasattr(message, 'status') and hasattr(message, 'name'): 664 + # Log detailed message attributes for debugging 665 + msg_type = getattr(message, 'message_type', 'unknown') 666 + has_tool_call_id = hasattr(message, 'tool_call_id') 667 + has_status = hasattr(message, 'status') 668 + has_name = hasattr(message, 'name') 669 + 670 + logger.debug(f"Message type={msg_type}, has_tool_call_id={has_tool_call_id}, has_status={has_status}, has_name={has_name}") 671 + 672 + if has_tool_call_id and has_status and has_name: 673 + logger.debug(f" -> tool_call_id={message.tool_call_id}, status={message.status}, name={message.name}") 674 + 663 675 if message.name == 'add_post_to_bluesky_reply_thread': 664 676 tool_call_results[message.tool_call_id] = message.status 665 677 logger.debug(f"Tool result: {message.tool_call_id} -> {message.status}") ··· 686 698 export_agent_state(CLIENT, void_agent, skip_git=SKIP_GIT) 687 699 logger.info("=== BOT TERMINATED DUE TO DEPRECATED TOOL USE ===") 688 700 exit(1) 689 - 701 + 702 + logger.debug(f"First pass complete. Collected {len(tool_call_results)} tool call results") 703 + logger.debug(f"tool_call_results: {tool_call_results}") 704 + 690 705 # Second pass: process messages and check for successful tool calls 691 706 for i, message in enumerate(message_response.messages, 1): 692 707 # Log concise message info instead of full object ··· 785 800 elif message.tool_call.name == 'add_post_to_bluesky_reply_thread': 786 801 tool_call_id = message.tool_call.tool_call_id 787 802 tool_status = tool_call_results.get(tool_call_id, 'unknown') 788 - 803 + 804 + logger.debug(f"Found add_post_to_bluesky_reply_thread tool call: id={tool_call_id}, status={tool_status}") 805 + logger.debug(f"Available tool_call_results: {tool_call_results}") 806 + 789 807 if tool_status == 'success': 790 808 try: 791 809 args = json.loads(message.tool_call.arguments) 792 810 reply_text = args.get('text', '') 793 811 reply_lang = args.get('lang', 'en-US') 794 - 812 + 795 813 if reply_text: # Only add if there's actual content 796 814 reply_candidates.append((reply_text, reply_lang)) 797 815 logger.debug(f"Found successful add_post_to_bluesky_reply_thread candidate: {reply_text[:50]}... (lang: {reply_lang})") ··· 801 819 logger.debug(f"Skipping failed add_post_to_bluesky_reply_thread tool call (status: error)") 802 820 else: 803 821 logger.warning(f"⚠️ Skipping add_post_to_bluesky_reply_thread tool call with unknown status: {tool_status}") 822 + logger.warning(f" Tool call ID '{tool_call_id}' not found in tool_call_results dict") 804 823 805 824 # Handle archival memory deletion if any were flagged (only if no halt was received) 806 825 if flagged_memories: