fix(gateway): redelivery dedups the stored turn but still re-runs the model #889

Closed
opened 2026-10-27 13:38:10 +00:00 by sam · 0 comments
Owner

archie-core-963 made SaveMessage idempotent, but nothing upstream consults the result. cmd/archied/telegram_setup.go:158 respond() calls SaveMessage (now a no-op on redelivery) then unconditionally loads history, calls the model, and saves the reply -- which carries no SourceID, so it always gets a fresh random ID and always appends.

CONFIRMED at store level on both backends: redelivering tg-1 leaves [ping, pong, pong], plus a second billed model turn with any tool side effects executed twice.

The bead's stated problem ('a re-delivered Telegram update appends a duplicate turn') is half fixed. SaveMessage returns no already-seen signal for the caller to act on.


Imported from beads archie-core-1786637499183-357-e3f7603f · GitHub #378 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08

archie-core-963 made SaveMessage idempotent, but nothing upstream consults the result. cmd/archied/telegram_setup.go:158 respond() calls SaveMessage (now a no-op on redelivery) then unconditionally loads history, calls the model, and saves the reply -- which carries no SourceID, so it always gets a fresh random ID and always appends. CONFIRMED at store level on both backends: redelivering tg-1 leaves [ping, pong, pong], plus a second billed model turn with any tool side effects executed twice. The bead's stated problem ('a re-delivered Telegram update appends a duplicate turn') is half fixed. SaveMessage returns no already-seen signal for the caller to act on. --- _Imported from beads `archie-core-1786637499183-357-e3f7603f` · GitHub #378 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumbug labels 2026-10-27 13:38:10 +00:00
sam self-assigned this 2026-10-27 13:38:10 +00:00
sam closed this issue 2026-10-27 13:38:10 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#889