fix: normalize conversation id for compression
This commit is contained in:
parent
2d083786bf
commit
c246e31e8b
@ -2167,7 +2167,8 @@ def get_conversation_messages(conversation_id, terminal: WebTerminal, workspace:
|
|||||||
def compress_conversation(conversation_id, terminal: WebTerminal, workspace: UserWorkspace, username: str):
|
def compress_conversation(conversation_id, terminal: WebTerminal, workspace: UserWorkspace, username: str):
|
||||||
"""压缩指定对话的大体积消息,生成压缩版新对话"""
|
"""压缩指定对话的大体积消息,生成压缩版新对话"""
|
||||||
try:
|
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"):
|
if not result.get("success"):
|
||||||
status_code = 404 if "不存在" in result.get("error", "") else 400
|
status_code = 404 if "不存在" in result.get("error", "") else 400
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user