fix(gateway): /topic off poisons the tracker cache with an empty session ID #894

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

CONFIRMED by execution. handleTopic (session_commands.go:200) 'off' does setActive(chan, "", getActive(chan, threadID)). With no session cached for (chan, threadID), getActive returns "" and that empty string is stored. resolve treats map presence as authoritative ('id, ok := t.active[key]; if ok { return id }'), and cacheActive also returns the empty existing value, so nothing can repair it.

Reachable when /topic off is the first message on the webhook (webhook.go:169) or email (email.go:207) channel -- both call router.Route directly and never call ResolveSessionKey first, unlike telegram's submitTurn.

Blast radius: every later message in that chat persists under session ID "", history is shared with any other poisoned chat, and the turn-lane key becomes "" so /stop in one chat kills a turn in another.

Same line is also non-atomic: setActive(...getActive(...)) is two critical sections, so a concurrent /resume or /branch is silently clobbered.


Imported from beads archie-core-1786637499318-363-a3050cb6 · GitHub #384 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08

CONFIRMED by execution. handleTopic (session_commands.go:200) 'off' does setActive(chan, "", getActive(chan, threadID)). With no session cached for (chan, threadID), getActive returns "" and that empty string is stored. resolve treats map presence as authoritative ('id, ok := t.active[key]; if ok { return id }'), and cacheActive also returns the empty existing value, so nothing can repair it. Reachable when /topic off is the first message on the webhook (webhook.go:169) or email (email.go:207) channel -- both call router.Route directly and never call ResolveSessionKey first, unlike telegram's submitTurn. Blast radius: every later message in that chat persists under session ID "", history is shared with any other poisoned chat, and the turn-lane key becomes "" so /stop in one chat kills a turn in another. Same line is also non-atomic: setActive(...getActive(...)) is two critical sections, so a concurrent /resume or /branch is silently clobbered. --- _Imported from beads `archie-core-1786637499318-363-a3050cb6` · GitHub #384 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumbug labels 2026-10-27 13:38:11 +00:00
sam self-assigned this 2026-10-27 13:38:11 +00:00
sam closed this issue 2026-10-27 13:38:11 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#894