IM Gateway & Deduplication

Gateway Concurrent Dedup & Progress Message Collapse

Decrypting gateway/run.py uniqueness hash deduplication and downstream edit_message card count updates
Gateway Dedup & Collapse
๐Ÿ“Š Figure 5-1-1: Gateway receive dedup, LLM multi-step execution progress collapse, and IM bubble edit modification flow

๐Ÿ”Œ 1. Uniqueness Deduplication (dedup_key)

External communication platforms often resend the same message when experiencing network jitter. In gateway/run.py, the system computes a unique dedup_key based on message_id + user_id + timestamp and stores it in cache or Redis. The gateway checks the key first and immediately discards duplicates.

Progress Message Merge
๐Ÿ“Š Figure 5-1-2: Downstream progress marking, merge queue insertion, and platform edit_message sequence diagram

๐Ÿ“‰ 2. __dedup__ Progress Indicator Merge & edit_message Bubble Refresh

When the LLM completes complex tasks, it often generates multiple tool calls. Sending every status as a new message would severely disrupt the user. Hermes introduces downstream progress collapse technology, using a special __dedup__ tag at the gateway level to perform in-place edit_message updates.