Issue: Report generator crashed with KeyError when processing log
entries that don't have token usage data (older logs created before
token tracking was implemented).
Fix:
- Initialize all token-related fields in stats dictionary
- Default to 0 when token_usage field doesn't exist in log entries
- Gracefully handle logs from before token tracking enhancement
Result:
- Reports now work with both old and new log entries
- Token fields show 0 for old entries (backward compatible)
- New analyses will populate token fields correctly
Tested: Report generation works with existing logs
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>