fix(webui): persist user messages for refresh

This commit is contained in:
chengyongru
2026-06-05 16:13:51 +08:00
committed by Xubin Ren
parent 3da68ac7fe
commit 710d00a179
5 changed files with 427 additions and 2 deletions
+7
View File
@@ -348,6 +348,12 @@ class GatewayHTTPHandler:
if not _is_websocket_channel_session_key(decoded_key):
return _http_error(404, "session not found")
scope = self.workspaces.scope_for_session_key(decoded_key)
session_messages: list[dict[str, Any]] | None = None
if self.session_manager is not None:
session_data = self.session_manager.read_session_file(decoded_key)
raw_messages = session_data.get("messages") if isinstance(session_data, dict) else None
if isinstance(raw_messages, list):
session_messages = [m for m in raw_messages if isinstance(m, dict)]
data = build_webui_thread_response(
decoded_key,
augment_user_media=self.media.augment_transcript_media,
@@ -356,6 +362,7 @@ class GatewayHTTPHandler:
text,
workspace_path=scope.project_path,
),
session_messages=session_messages,
)
if data is None:
return _http_error(404, "webui thread not found")