Skip to content

fix(gateway): deduplicate Weixin messages by content fingerprint - #19742

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(gateway): deduplicate Weixin messages by content fingerprint#19742
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1

@teknium1 teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #16190 by @PratikRai0101 onto current main.

Summary

The Weixin (ilinkai) upstream occasionally delivers the same logical message twice within a ~3-second window with distinct message_id values, so the existing message_id-based dedup misses the duplicate and the agent handles both copies. Add a secondary content-fingerprint dedup keyed on content:<sender_id>:<md5(text)> to catch the real duplicate case, only for text messages.

Conflict resolution during salvage

Test file picked up a TestIsStaleSessionRet class from a separate landed fix; preserved both that class and the new TestWeixinContentDedup class.

Changes

  • gateway/platforms/weixin.py: content-fingerprint dedup branch (+9/-2)
  • tests: TestWeixinContentDedup with duplicate-content + no-text-skip regressions

Validation

scripts/run_tests.sh tests/gateway/test_weixin.py -> 51 passed

Original PR: #16190
Fixes: #16182

@teknium1
teknium1 merged commit 7a8ee8b into main May 4, 2026
7 of 10 checks passed
@teknium1
teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 12:20
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Weixin adapter: duplicate inbound messages — same content delivered twice with different message_id

3 participants