diff --git a/web_server.py b/web_server.py index 6972b18..255bbf4 100644 --- a/web_server.py +++ b/web_server.py @@ -2167,7 +2167,8 @@ def get_conversation_messages(conversation_id, terminal: WebTerminal, workspace: def compress_conversation(conversation_id, terminal: WebTerminal, workspace: UserWorkspace, username: str): """压缩指定对话的大体积消息,生成压缩版新对话""" try: - result = terminal.context_manager.compress_conversation(conversation_id) + normalized_id = conversation_id if conversation_id.startswith('conv_') else f"conv_{conversation_id}" + result = terminal.context_manager.compress_conversation(normalized_id) if not result.get("success"): status_code = 404 if "不存在" in result.get("error", "") else 400