Revert "refactor: remove legacy history and proxy migrations (#6518)"

This reverts commit cb3ba45317.

Keep JSONL history and legacy proxy migration available throughout 0.4.x. Mark their removal for 0.5.0 in code and release guidance, preserving later context graph, archive and recovery changes.
This commit is contained in:
chengyongru authored and chengyongru committed 2026-11-06 10:58:10 +08:00
1 parent 3918ece17f
commit 812b92d734
47 files changed
+1932 -204

No files matched your search

+40
View File
@@ -349,6 +349,46 @@ async def test_sidebar_allocates_handles_then_reads_during_pending_write(tmp_pat
await state.aclose()
def test_webui_session_list_fallback_time_when_missing(tmp_path: Path) -> None:
legacy = tmp_path / "sessions"
legacy.mkdir()
path = legacy / "websocket_missing-time.jsonl"
path.write_text(
'{"_type": "metadata", "key": "websocket:missing-time"}\n'
'{"_type": "message", "role": "user", "content": "hello"}\n',
encoding="utf-8",
)
manager = SessionManager(tmp_path)
rows = list_webui_sessions(manager)
assert len(rows) == 1
assert rows[0]["key"] == "websocket:missing-time"
assert rows[0]["created_at"] is not None
assert rows[0]["updated_at"] is not None
datetime.fromisoformat(rows[0]["created_at"])
datetime.fromisoformat(rows[0]["updated_at"])
def test_session_manager_list_sessions_fallback_time_when_missing(tmp_path: Path) -> None:
legacy = tmp_path / "sessions"
legacy.mkdir()
path = legacy / "websocket_missing-time2.jsonl"
path.write_text(
'{"_type": "metadata", "key": "websocket:missing-time2"}\n'
'{"_type": "message", "role": "user", "content": "hello"}\n',
encoding="utf-8",
)
manager = SessionManager(tmp_path)
sessions = manager.list_sessions()
assert len(sessions) == 1
assert sessions[0]["key"] == "websocket:missing-time2"
assert sessions[0]["created_at"] is not None
assert sessions[0]["updated_at"] is not None
datetime.fromisoformat(sessions[0]["created_at"])
datetime.fromisoformat(sessions[0]["updated_at"])
def test_sidebar_uses_durable_display_summary_and_filters_private_sessions(history):
sessions = history.sessions
sessions.types.register(SessionType("internal", needs_handle=False, public_history=False))