mirror of
https://github.com/crewAIInc/crewAI.git
synced 2025-12-16 04:18:35 +00:00
The task_started method was calling _operation() twice when telemetry was enabled: 1. Once inside _safe_telemetry_operation() 2. Once again when returning the span This caused duplicate span creation and could lead to the app freezing on 'thinking' when using CrewAI Tracing, especially with slow network connections or telemetry endpoint issues. The fix removes the call to _safe_telemetry_operation() and directly calls _operation() once, returning its result. This ensures spans are only created once per task start. Added comprehensive tests to verify: - task_started only creates spans once when telemetry is enabled - task_started returns None when telemetry is disabled Co-Authored-By: João <joao@crewai.com>