Skip to content

fix: populate task metadata in streaming chunks from event data#4622

Open
Anandesh-Sharma wants to merge 1 commit intocrewAIInc:mainfrom
Anandesh-Sharma:fix/4347-streaming-task-metadata
Open

fix: populate task metadata in streaming chunks from event data#4622
Anandesh-Sharma wants to merge 1 commit intocrewAIInc:mainfrom
Anandesh-Sharma:fix/4347-streaming-task-metadata

Conversation

@Anandesh-Sharma
Copy link

Summary

  • Fixes streaming chunks having empty task_name and task_id fields
  • _create_stream_chunk now prefers event.task_name and event.task_id from the LLMStreamChunkEvent over the current_task_info defaults
  • The event already carries task metadata set during LLM call context, but it was being ignored for these two fields

Fixes #4347

Test plan

  • Enable stream=True on a Crew and verify chunks contain populated task_name and task_id
  • Verify agent_role and agent_id continue to work (they already used event data)
  • Test with multiple sequential tasks to verify correct task attribution

🤖 Generated with Claude Code

The _create_stream_chunk function was using current_task_info for
task_name and task_id, ignoring the values already populated on the
LLMStreamChunkEvent. Since the event carries task metadata from the
LLM call context, prefer those values over current_task_info which
may have empty defaults.

Fixes crewAIInc#4347

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Crew streaming chunks missing task metadata (task_id/task_name/task_index empty)

1 participant