a digital person for bluesky

Fix ATProto record types for tool calls and reasoning

- Change from stream.thought.ack embedded format back to dedicated collections
- Use stream.thought.tool.call for tool call records (dots for valid NSID)
- Use stream.thought.reasoning for reasoning records
- Add better error logging for debugging record creation issues

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

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

+8 -2
+8 -2
bsky_utils.py
··· 609 609 """ 610 610 try: 611 611 import requests 612 + import json 612 613 from datetime import datetime, timezone 613 614 614 615 # Get session info from the client ··· 681 682 """ 682 683 try: 683 684 import requests 685 + import json 684 686 from datetime import datetime, timezone 685 687 686 688 # Get session info from the client ··· 757 759 """ 758 760 try: 759 761 import requests 762 + import json 760 763 from datetime import datetime, timezone 761 764 762 765 # Get session info from the client ··· 783 786 # Create tool call record 784 787 now = datetime.now(timezone.utc).isoformat().replace("+00:00", "Z") 785 788 tool_record = { 786 - "$type": "stream.thought.tool_call", 789 + "$type": "stream.thought.tool.call", 787 790 "tool_name": tool_name, 788 791 "arguments": arguments, # Store as string to avoid parsing issues 789 792 "createdAt": now ··· 799 802 800 803 create_data = { 801 804 "repo": user_did, 802 - "collection": "stream.thought.tool_call", 805 + "collection": "stream.thought.tool.call", 803 806 "record": tool_record 804 807 } 805 808 806 809 response = requests.post(create_record_url, headers=headers, json=create_data, timeout=10) 810 + if response.status_code != 200: 811 + logger.error(f"Tool call record creation failed: {response.status_code} - {response.text}") 807 812 response.raise_for_status() 808 813 result = response.json() 809 814 ··· 831 836 """ 832 837 try: 833 838 import requests 839 + import json 834 840 from datetime import datetime, timezone 835 841 836 842 # Get session info from the client