fix: make todo list update dynamically when task status changes (#999)
areRenderRelevantPartsEqual did not compare the tool part output field, so when the AI updated a todo list (e.g., marking items completed) the ToolPart memo comparator returned true and skipped re-render. The UI stuck showing stale task status. Fix: add output reference comparison for tool parts in areRenderRelevantPartsEqual so streaming tool output updates trigger re-renders correctly. Co-authored-by: Shyamalan Kannan <yabuku@Shyamalans-MacBook-Pro.local>
This commit is contained in:
committed by
GitHub
co-authored by
Shyamalan Kannan
parent
2fc2914fde
commit
632e6cc97b
@@ -80,6 +80,13 @@ export const areRenderRelevantPartsEqual = (left: Part[], right: Part[]): boolea
|
||||
if (leftTool !== rightTool) {
|
||||
return false;
|
||||
}
|
||||
// Compare tool output so streaming updates (e.g., todo list progress)
|
||||
// trigger re-renders when the output payload changes.
|
||||
const leftOutput = (leftPart as { output?: unknown }).output;
|
||||
const rightOutput = (rightPart as { output?: unknown }).output;
|
||||
if (leftOutput !== rightOutput) {
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user