Three gateway slash commands have bugs that make them either completely non functional or silently destructive.
Bug 1 - /retry and /undo set a non-existent attribute on SessionEntry
File: gateway/run.py, lines 1138 and 1170
Both commands assign to session_entry.conversation_history:
# /retry - line 1138
session_entry.conversation_history = truncated
# /undo - line 1170
session_entry.conversation_history = history[:last_user_idx]
SessionEntry (defined in gateway/session.py, line 204) is a dataclass with no conversation_history field. Python dataclasses allow setting arbitrary attributes without raising an error, so a dangling attribute is silently created that nothing ever reads.
The actual conversation history is loaded from the transcript via load_transcript() at run.py:1122 for /retry and run.py:1156 for /undo, but neither command modifies or rewrites the transcript. When /retry calls _handle_message() at line 1149, that method calls load_transcript() again at line 683, reloading the full unmodified transcript.
Result:
/retry resends the user message but the old failed response is still in context
/undo reports "Undid N message(s)" but the "undone" messages reappear on the next interaction
Bug 2 - /reset accesses non-existent _sessions attribute on SessionStore
File: gateway/run.py, line 910
old_entry = self.session_store._sessions.get(session_key)
SessionStore stores its entries in self._entries (defined at gateway/session.py, line 290), not self._sessions. This raises an AttributeError, which is caught by the except Exception block at line 939. The entire pre-reset memory flush is silently skipped and the agent never gets a chance to persist memories before the session is wiped.
Result: Users lose all unsaved memories on every /reset or /new.
Steps to reproduce
- Start a gateway session on any messaging platform (Telegram, Discord, Slack, or WhatsApp)
- Have a multi turn conversation
- Type
/undo - response says "Undid N messages" but the next message still has full unmodified history
- Type
/retry - resends the last message but the old response remains in context
- Type
/reset - session resets but memories from the conversation are not persisted
Suggested fix
- /retry and /undo: Replace the dangling attribute assignment with actual transcript modification, either rewrite the transcript file via
SessionStore or truncate the history in the state database before re-entering the message handler.
- /reset: Change
self.session_store._sessions to self.session_store._entries on line 910.
Three gateway slash commands have bugs that make them either completely non functional or silently destructive.
Bug 1 - /retry and /undo set a non-existent attribute on SessionEntry
File:
gateway/run.py, lines 1138 and 1170Both commands assign to
session_entry.conversation_history:SessionEntry(defined ingateway/session.py, line 204) is a dataclass with noconversation_historyfield. Python dataclasses allow setting arbitrary attributes without raising an error, so a dangling attribute is silently created that nothing ever reads.The actual conversation history is loaded from the transcript via
load_transcript()atrun.py:1122for/retryandrun.py:1156for/undo, but neither command modifies or rewrites the transcript. When/retrycalls_handle_message()at line 1149, that method callsload_transcript()again at line 683, reloading the full unmodified transcript.Result:
/retryresends the user message but the old failed response is still in context/undoreports "Undid N message(s)" but the "undone" messages reappear on the next interactionBug 2 - /reset accesses non-existent _sessions attribute on SessionStore
File:
gateway/run.py, line 910SessionStorestores its entries inself._entries(defined atgateway/session.py, line 290), notself._sessions. This raises anAttributeError, which is caught by theexcept Exceptionblock at line 939. The entire pre-reset memory flush is silently skipped and the agent never gets a chance to persist memories before the session is wiped.Result: Users lose all unsaved memories on every
/resetor/new.Steps to reproduce
/undo- response says "Undid N messages" but the next message still has full unmodified history/retry- resends the last message but the old response remains in context/reset- session resets but memories from the conversation are not persistedSuggested fix
SessionStoreor truncate the history in the state database before re-entering the message handler.self.session_store._sessionstoself.session_store._entrieson line 910.