fix: prevent duplicate message delivery in communicate service#539
Open
fix: prevent duplicate message delivery in communicate service#539
Conversation
- Add warning admonition to install.md explaining CLI defaults to production ports (7xxx); `source .env` needed for dev ports - Update port reference tables in getting-started.md and install.md to include agentd-communicate (17010/7010) and agentd-memory (7008) - Add troubleshooting entry for "agent status shows services as down" with workaround and reference to issue #536 - Fix install.md troubleshooting to use production ports (7xxx) for installed services rather than dev ports (17xxx) Refs #536 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two fixes for the message duplication bug (#534) where each room message was delivered 4-5x to agents, creating a compounding echo loop: 1. Communicate WebSocket (websocket.rs): Abort the old subscription task before replacing it in the HashMap when a client resubscribes to a room. Previously, the old task was silently orphaned and continued forwarding messages, causing duplicate deliveries after reconnection. 2. Orchestrator MessageBridge (message_bridge.rs): Add a seen-message deduplication set that tracks recently processed message IDs. Messages already seen are skipped before delivery to agents. The set is capped at 1000 entries to bound memory usage. Closes #534 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #539 +/- ##
==========================================
- Coverage 55.36% 55.36% -0.01%
==========================================
Files 126 126
Lines 13505 13513 +8
==========================================
+ Hits 7477 7481 +4
- Misses 6028 6032 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
Author
|
pretty sure this is a duplicate from multiple work streams trying to fix the same problem. need to confirm then close. |
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.
Summary
websocket.rs). When a client resubscribes to a room (e.g. after reconnection), the old forwarding task was silently orphaned and continued delivering messages alongside the new task, causing 4-5x duplicate delivery.message_bridge.rs). A seen-message set (capped at 1000 entries) skips messages that have already been processed, providing a second layer of defense against duplicates.Closes #537
Test plan
cargo check -p communicate -p orchestratorpassescargo clippy -p communicate -p orchestrator --no-depsis clean🤖 Generated with Claude Code