Files
crewAI/lib
Devin AI 41ec7f6ce0 fix: populate task_id and task_name in streaming chunks from event
Fixes #4347 - Crew streaming chunks were missing task metadata (task_id/task_name empty).

The issue was in _create_stream_chunk() which only used current_task_info for
task_name and task_id, ignoring the values from the LLMStreamChunkEvent. This
is inconsistent with how agent_role and agent_id were handled (preferring event
values).

The fix updates _create_stream_chunk() to use event.task_name and event.task_id
when available, falling back to current_task_info values otherwise.

Added test to verify streaming chunks contain task metadata from events.

Co-Authored-By: João <joao@crewai.com>
2026-02-03 12:45:48 +00:00
..