fix: await updateClineMessage calls to prevent duplicate reasoning blocks #4892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue where reasoning blocks were being rendered multiple times instead of updating in place during streaming responses.
Problem
When the AI streams reasoning content, the
ReasoningBlockcomponent was rendering multiple instances instead of updating a single instance. This was caused by a race condition in theTask.tsfile whereupdateClineMessagewas being called without awaiting its completion.Solution
Added
awaitto allupdateClineMessagecalls inTask.tsto ensure that message updates complete before proceeding with the next update. This prevents the race condition that was causing duplicate rendering.Changes
awaitto 4updateClineMessagecalls insrc/core/task/Task.tsTesting
The fix ensures that:
Fixes the issue where reasoning blocks were rendered multiple times during streaming responses.
Important
Fixes race condition in
Task.tsby addingawaittoupdateClineMessagecalls, preventing duplicate reasoning blocks during streaming responses.Task.tsby addingawaittoupdateClineMessagecalls, ensuring message updates complete before proceeding.awaitto 4updateClineMessagecalls inTask.ts.This description was created by
for 639cb78. You can customize this summary. It will automatically update as commits are pushed.