fix(streaming): Prioritize using task_name/task_id from events, fallb…#4163
fix(streaming): Prioritize using task_name/task_id from events, fallb…#4163howiefh wants to merge 4 commits into
Conversation
…ack to current_task_info
There was a problem hiding this comment.
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"], |
There was a problem hiding this comment.
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.
|
This PR is stale because it has been open for 45 days with no activity. |
|
This PR is stale because it has been open for 45 days with no activity. |
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_idcarried onLLMStreamChunkEventwhen buildingStreamChunk, with fallback tocurrent_task_infowhen 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.