Fix X username caching at mention fetch time
**Root cause fixed:**
- get_mentions() was only returning mention data, losing user info from API response
- This caused "@unknown (unknown)" when processing mentions later
**Complete solution implemented:**
1. **Modified get_mentions() method**:
- Returns dict with both 'mentions' and 'users' keys
- Preserves user data from API response includes.users field
- Logs when user data is retrieved
2. **Enhanced save_mention_to_queue()**:
- Accepts optional users_data parameter
- Caches author username/name in 'author_info' field
- Preserves this data in queued mention JSON files
3. **Updated fetch_and_queue_mentions()**:
- Extracts both mentions and users from get_mentions() result
- Passes user data to save_mention_to_queue()
- Ensures usernames are cached when mentions arrive
4. **Improved process_x_mention()**:
- First tries cached author_info from queued mention
- Falls back to thread data lookup (existing logic)
- Finally falls back to thread tweet scan
- Three-tier fallback system for maximum reliability
**Benefits:**
- Fixes the root cause by capturing usernames when available from API
- No extra API calls needed
- Backward compatible with existing queued mentions
- Usernames reliably available even when thread context fails
This ensures usernames are properly cached when mentions are fetched, eliminating the "@unknown" issue that void was experiencing.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>