refactor(sessions): persist archive state in SQLite (#6536)

* feat(webui): add archived chat management

* fix(webui): keep archived chats in the sidebar

* feat(webui): scope archived topics to sidebar groups

* fix(webui): reuse group dissolve label

* fix(webui): fail fast when adding panes

* refactor(sessions): persist archive state in SQLite

* refactor: limit archive changes to SQLite storage

* perf(sessions): avoid redundant archive I/O and read barriers

* fix(sessions): archive only persisted conversations
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-03 15:58:41 +08:00
1 parent 58a05ea3e0
commit 80ac41b1f4
16 files changed
+751 -107

No files matched your search

+3 -3
View File
@@ -56,7 +56,7 @@ from nanobot.utils.helpers import sync_workspace_templates
from nanobot.utils.token_encoding import warmup_token_encoding
from nanobot.webui.build import BuildMode
from nanobot.webui.dev import WebUIDevError, WebUIDevServer
from nanobot.webui.sidebar_state import read_webui_sidebar_state
from nanobot.webui.sidebar_state import ensure_webui_session_archives
if TYPE_CHECKING:
from nanobot.update_profiles import ProfileReceipt
@@ -829,7 +829,7 @@ def _run_claimed_gateway(
)
async def _pick_heartbeat_target() -> tuple[str, str]:
sidebar_state = await asyncio.to_thread(read_webui_sidebar_state)
archived_keys = await ensure_webui_session_archives(session_manager.state)
unified_metadata = None
if config.agents.defaults.unified_session:
record = await session_manager.state.read_metadata(UNIFIED_SESSION_KEY)
@@ -838,7 +838,7 @@ def _run_claimed_gateway(
return _pick_heartbeat_target_from_sessions(
enabled_channels=channels.enabled_channels,
sessions=await session_manager.state.list_sessions(),
archived_keys=sidebar_state.get("archived_keys", []),
archived_keys=archived_keys,
unified_session_metadata=unified_metadata,
)