Skip to content

fix(streaming): Prioritize using task_name/task_id from events, fallb…#4163

Open
howiefh wants to merge 4 commits into
crewAIInc:mainfrom
howiefh:patch-1
Open

fix(streaming): Prioritize using task_name/task_id from events, fallb…#4163
howiefh wants to merge 4 commits into
crewAIInc:mainfrom
howiefh:patch-1

Conversation

@howiefh
Copy link
Copy Markdown

@howiefh howiefh commented Dec 30, 2025

Prioritize using task_name/task_id from events, fallback to current_task_info to ensure correct task_id and task_name are obtained in StreamChunk


Note

Low Risk
Small, localized change to streaming metadata selection with minimal behavioral impact beyond correcting task attribution.

Overview
Fixes streaming metadata by preferring task_name/task_id carried on LLMStreamChunkEvent when building StreamChunk, with fallback to current_task_info when the event fields are missing.

This ensures streamed chunks are attributed to the correct task when event-level task identifiers differ from the current tracked task context.

Written by Cursor Bugbot for commit ad4c9e8. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

task_name=current_task_info["name"],
task_id=current_task_info["id"],
task_name=event.task_name or current_task_info["name"],
task_id=event.task_id or current_task_info["id"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent task_index when event has different task info

The task_index is always sourced from current_task_info, while task_name and task_id now preferentially come from the event. If an event's task_id/task_name differs from current_task_info, the resulting StreamChunk will have task_index pointing to a different task than task_id/task_name. Before this change, all three fields came from the same source and were guaranteed consistent. Consumers of StreamChunk may expect these fields to reference the same task.

Fix in Cursor Fix in Web

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 45 days with no activity.

@github-actions
Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 45 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant