fix(ui): avoid false stale chat send guard#2034
Open
erauner12 wants to merge 9 commits into
Open
Conversation
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates the cross-tab “send guard” logic in ChatInterface to avoid falsely blocking sends when same-tab streaming messages are already visible, and adds Jest coverage for the updated behavior.
Changes:
- Count comparable messages using both stored + streaming messages (and exclude specific ADK
originalTypes) to prevent false “stale messages” blocks. - Reuse the same comparable-message counting logic for both local and DB message comparisons.
- Add a dedicated test suite validating send-guard behavior across same-tab streaming and cross-tab updates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ui/src/components/chat/ChatInterface.tsx | Refines send-guard message counting and centralizes exclusion logic to reduce false blocks. |
| ui/src/components/chat/tests/ChatInterface.sendGuard.test.tsx | Adds regression tests covering same-tab streaming vs cross-tab message scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
1 small thing worth adding: a 1-line comment on why |
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
Signed-off-by: Evan Rauner <raunerevan@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes a false-positive chat send guard that can show
New messages loaded — please review before sendingduring normal same-tab usage after an agent response has already completed and is visible.The send guard now compares backend-derived messages against all locally visible comparable messages instead of only persisted/stored messages. This preserves the intended cross-tab stale-message warning while allowing the next same-tab send to proceed.
Fixes #2033.
Changes
Validation
Automated:
Result:
Previously also run successfully during branch validation:
Manual:
kind-kagent.New messages loadedtoast after a completed agent response.