Prevent duplicate processing of the same platform message. At-least-once delivery (webhook retries, Telegram long-poll re-fetch after a slow ack, forge redelivery) can hand the gateway the same MessageEvent more than once; without a dedup layer it gets answered twice.
Context for implementers
internal/gateway/messageevent.go already carries a platform-assigned ID field (MessageEvent.ID, see line ~59) suitable as a dedup key alongside ChannelID/Platform. There is currently no dedup file in internal/gateway — this is new code, not a rename. Related but distinct: archie-core-ippu (gateway: replay and redelivery lose tool activity) covers a different symptom — a replayed turn losing its tool-call history in the transcript, not a duplicate inbound message being processed twice. Fix this one first; it may reduce (but won't eliminate) triggers for the other.
Acceptance Criteria
A MessageDeduplicator (or equivalent) keyed on platform + channel + message ID rejects a second delivery of the same message within a configurable TTL window. TTL expiry is covered by a test using an injected clock, not a real sleep. Memory use is bounded (LRU or TTL sweep), not an unbounded map.
Close reason
Closed
Imported from beads archie-core-1786637492498-104-1bde76ae · GitHub #125 · type task · priority P2 · created 2026-08-08 · closed 2026-10-01
Prevent duplicate processing of the same platform message. At-least-once delivery (webhook retries, Telegram long-poll re-fetch after a slow ack, forge redelivery) can hand the gateway the same `MessageEvent` more than once; without a dedup layer it gets answered twice.
### Context for implementers
`internal/gateway/messageevent.go` already carries a platform-assigned `ID` field (`MessageEvent.ID`, see line ~59) suitable as a dedup key alongside `ChannelID`/`Platform`. There is currently no dedup file in `internal/gateway` — this is new code, not a rename. Related but distinct: `archie-core-ippu` (gateway: replay and redelivery lose tool activity) covers a different symptom — a replayed *turn* losing its tool-call history in the transcript, not a duplicate inbound message being processed twice. Fix this one first; it may reduce (but won't eliminate) triggers for the other.
### Acceptance Criteria
A `MessageDeduplicator` (or equivalent) keyed on platform + channel + message ID rejects a second delivery of the same message within a configurable TTL window. TTL expiry is covered by a test using an injected clock, not a real sleep. Memory use is bounded (LRU or TTL sweep), not an unbounded map.
### Close reason
Closed
---
_Imported from beads `archie-core-1786637492498-104-1bde76ae` · GitHub #125 · type task · priority P2 · created 2026-08-08 · closed 2026-10-01_
sam
added the mediumtask labels 2026-10-27 13:37:06 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Prevent duplicate processing of the same platform message. At-least-once delivery (webhook retries, Telegram long-poll re-fetch after a slow ack, forge redelivery) can hand the gateway the same
MessageEventmore than once; without a dedup layer it gets answered twice.Context for implementers
internal/gateway/messageevent.goalready carries a platform-assignedIDfield (MessageEvent.ID, see line ~59) suitable as a dedup key alongsideChannelID/Platform. There is currently no dedup file ininternal/gateway— this is new code, not a rename. Related but distinct:archie-core-ippu(gateway: replay and redelivery lose tool activity) covers a different symptom — a replayed turn losing its tool-call history in the transcript, not a duplicate inbound message being processed twice. Fix this one first; it may reduce (but won't eliminate) triggers for the other.Acceptance Criteria
A
MessageDeduplicator(or equivalent) keyed on platform + channel + message ID rejects a second delivery of the same message within a configurable TTL window. TTL expiry is covered by a test using an injected clock, not a real sleep. Memory use is bounded (LRU or TTL sweep), not an unbounded map.Close reason
Closed
Imported from beads
archie-core-1786637492498-104-1bde76ae· GitHub #125 · type task · priority P2 · created 2026-08-08 · closed 2026-10-01