Skip to content

/retry and /undo gateway commands have no effect, /reset silently loses memories #210

@Farukest

Description

@Farukest

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

  1. Start a gateway session on any messaging platform (Telegram, Discord, Slack, or WhatsApp)
  2. Have a multi turn conversation
  3. Type /undo - response says "Undid N messages" but the next message still has full unmodified history
  4. Type /retry - resends the last message but the old response remains in context
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions