fix: prevent notification sound on attempt_completion with queued messages #8540
+524
−1
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.
Summary
This PR fixes the issue where the notification sound incorrectly plays when
attempt_completionis called despite having messages already queued. This was misleading users into thinking input was required when the task would actually continue automatically with the queued message.Problem
When a user types a message during task execution, it gets queued. When the task reaches
attempt_completion, the celebration sound was playing even though the queued message would be automatically processed, creating confusion about whether the task had truly paused or would continue on its own.Solution
Added a check for
messageQueue.lengthbefore playing the celebration sound. The sound now only plays when:!isPartial)messageQueue.length === 0)Changes
messageQueue.length === 0condition to line 398Testing
Fixes #8537
Important
Fixes notification sound issue in
ChatView.tsxby adding a condition to prevent sound when messages are queued.ChatView.tsx, addedmessageQueue.length === 0condition to play celebration sound only when there are no queued messages and the message is not partial.ChatView.notification-sound.spec.tsxwith tests for:This description was created by
for bc91daa. You can customize this summary. It will automatically update as commits are pushed.