fix(session-state): keep the canonical Bot Chat hidden when pinned
set_session_pinned's unconditional hidden-clear (0be7f931) also unhides the canonical Bot Chat, which the desktop contract requires to stay hidden and reachable only through the bot row. Exposing it breaks the sidebar and disables the rename guard that protects its identity title. Skip the unhide when the pinned row is hidden and carries the exact canonical title; ordinary hidden sessions are unaffected.
This commit is contained in:
@@ -4476,7 +4476,17 @@ class TestSessionPinAndStaleArchive:
|
||||
listed_ids = [s["id"] for s in db.list_sessions_rich(min_message_count=1)]
|
||||
assert "s1" in listed_ids
|
||||
|
||||
def test_pinning_the_canonical_bot_chat_leaves_it_hidden(self, db):
|
||||
"""The canonical Bot Chat (hidden + exact registry title) is desktop-owned and must stay
|
||||
hidden even when pinned, or it leaks into the Sessions sidebar and loses its rename guard
|
||||
(review on #106180). Unlike an ordinary hidden session, pinning must not clear ``hidden``."""
|
||||
db.create_session(session_id="bot1", source="desktop")
|
||||
db.set_session_title("bot1", db.CANONICAL_BOT_CHAT_TITLE)
|
||||
db.set_session_hidden("bot1", True)
|
||||
|
||||
db.set_session_pinned("bot1", True)
|
||||
|
||||
assert db.get_session("bot1")["hidden"] == 1
|
||||
|
||||
# ── pinned back-fill past the page window ─────────────────────────────
|
||||
def test_pinned_session_survives_the_limit_window(self, db):
|
||||
|
||||
Reference in New Issue
Block a user