From 3f2180037c40f27bf93eafae0421adb2512a516e Mon Sep 17 00:00:00 2001 From: Teknium Date: Fri, 3 Apr 2026 14:50:01 -0700 Subject: [PATCH] fix: also filter session_meta in /session switch restore path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original PR missed the third CLI restore path — the /session switch command that loads history via get_messages_as_conversation() without stripping session_meta entries. --- cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index ed3931afe..4e96107e3 100644 --- a/cli.py +++ b/cli.py @@ -3261,9 +3261,10 @@ class HermesCLI: self._resumed = True self._pending_title = None - # Load conversation history + # Load conversation history (strip transcript-only metadata entries) restored = self._session_db.get_messages_as_conversation(target_id) - self.conversation_history = restored or [] + restored = [m for m in (restored or []) if m.get("role") != "session_meta"] + self.conversation_history = restored # Re-open the target session so it's not marked as ended try: