mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-07 11:38:16 +00:00
In first_time_trace_handler._initialize_backend_and_send_events, backend_initialized was set to True unconditionally after calling _initialize_backend_batch, regardless of whether the server-side batch was actually created. This caused _send_events_to_backend and finalize_batch to run against a non-existent batch. Now check trace_batch_id after _initialize_backend_batch returns; if None (batch creation failed), call _gracefully_fail and return early, skipping event send and finalization.