Concurrent flush() calls now await the ongoing flush instead of returning immediately, preventing data loss when session_end triggers flush() while a timer-triggered flush is already in progress. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>