fix(session): split safe_key and _storage_key to fix WebUI coupling (#4533)

This commit is contained in:
axelray-dev
2026-06-27 16:52:54 +08:00
committed by Xubin Ren
parent cf2f589615
commit 00a907c493
4 changed files with 63 additions and 15 deletions
+2 -2
View File
@@ -58,11 +58,11 @@ def test_read_session_file_missing(tmp_path: Path) -> None:
assert sm.read_session_file("nope:none") is None
def test_safe_key_matches_internal_path(tmp_path: Path) -> None:
def test_storage_key_matches_internal_path(tmp_path: Path) -> None:
sm = SessionManager(tmp_path)
key = "telegram:abc/def"
expected = sm._get_session_path(key).name
assert SessionManager.safe_key(key) + ".jsonl" == expected
assert SessionManager._storage_key(key) + ".jsonl" == expected
def _write_legacy_session(legacy_dir: Path, key: str, roles: list[str]) -> Path: