Files
crewAI/lib
Devasy Patel 0f0538cca7 Fix async task token tracking race condition
Resolved race condition where concurrent async tasks from same agent
would get incorrect token attribution. Solution wraps async task execution
to capture tokens_after immediately upon task completion, before other
concurrent tasks can interfere.

Changes:
- Wrapped async task execution to return (result, tokens_after) tuple
- Updated _aprocess_async_tasks to unwrap and use captured tokens_after
- Updated type hints for pending_tasks to reflect new signature

Note: Threading-based async_execution still has similar race condition
as it's harder to wrap threaded execution. Will track separately.
2026-01-03 22:42:51 +05:30
..
2025-12-19 15:47:00 -05:00
2025-12-19 15:47:00 -05:00