Files
hermes-agent/website/docs
Teknium 5b37107d3d fix(gateway): a repeat handoff moves the Telegram topic; a lost bind race never splits route and binding
Review of #152292 (Request changes) and the Greptile thread "Resume fails halfway through":

1. Round trip regression: hand off into topic A, `/resume` on the CLI, hand off again was refused
   ("already linked") because A's binding is never cleared and the CLI keeps the session id; the
   refusal also left an empty, freshly created topic. A handoff carries the conversation, so the
   bind now MOVES it (`bind_telegram_topic(move_session=True)`): the old topic's row is dropped in
   the same transaction and, under `_TOPIC_SWITCH_BIND_LOCK`, the old topic's route is released
   (`SessionStore.release_route`, nothing ended), so it starts afresh next message and two topics
   never route to one session. A session bound to ANOTHER profile's topic (never moved) is refused
   before `create_handoff_thread` runs, so a refusal opens no topic.
2. /resume and /branch --here: losing the race between the conflict check and the bind raised a
   bare ValueError after the route switch (route on target, binding on old, reply lost). The route
   is now put back (`SessionStore.restore_route`, CAS on the switched id, reopens the row the
   switch ended) and the command replies with the "already linked" text.
3. Handoff losing the same race: with (1) the bind moves the binding instead of failing, so the
   handoff completes with route = binding = the handed-off session.
2026-11-10 13:11:07 -08:00
..
2026-11-10 11:37:47 -05:00