a digital person for bluesky

Reduce parent_height from 80 to 40 and add thread debugging

- Reduced parent_height parameter from 80 to 40 to limit deep thread nesting
- Added debug print/exit to inspect thread prompt structure
- Improved thread preview logging to show meaningful content fields
- This helps identify the token-inefficient YAML representation issue

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

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

Changed files
+26 -2
+26 -2
bsky.py
··· 216 216 try: 217 217 thread = atproto_client.app.bsky.feed.get_post_thread({ 218 218 'uri': uri, 219 - 'parent_height': 80, 219 + 'parent_height': 40, 220 220 'depth': 10 221 221 }) 222 222 except Exception as e: ··· 235 235 try: 236 236 thread_context = thread_to_yaml_string(thread) 237 237 logger.info(f"Thread context generated, length: {len(thread_context)} characters") 238 - logger.debug(f"Thread context preview: {thread_context[:500]}...") 238 + 239 + # Create a more informative preview by extracting meaningful content 240 + lines = thread_context.split('\n') 241 + meaningful_lines = [] 242 + 243 + for line in lines: 244 + stripped = line.strip() 245 + if not stripped: 246 + continue 247 + 248 + # Look for lines with actual content (not just structure) 249 + if any(keyword in line for keyword in ['text:', 'handle:', 'display_name:', 'created_at:', 'reply_count:', 'like_count:']): 250 + meaningful_lines.append(line) 251 + if len(meaningful_lines) >= 5: 252 + break 253 + 254 + if meaningful_lines: 255 + preview = '\n'.join(meaningful_lines) 256 + logger.debug(f"Thread content preview:\n{preview}") 257 + else: 258 + # If no content fields found, just show it's a thread structure 259 + logger.debug(f"Thread structure generated ({len(thread_context)} chars)") 239 260 except Exception as yaml_error: 240 261 import traceback 241 262 logger.error(f"Error converting thread to YAML: {yaml_error}") ··· 260 281 The YAML above shows the complete conversation thread. The most recent post is the one mentioned above that you should respond to, but use the full thread context to understand the conversation flow. 261 282 262 283 Use the bluesky_reply tool to send a response less than 300 characters.""" 284 + 285 + print(prompt) 286 + exit() 263 287 264 288 # Extract all handles from notification and thread data 265 289 all_handles = set()