fix: enforce personalization tool disables in api flows
This commit is contained in:
parent
51f61b04d2
commit
f7034a3047
@ -249,6 +249,11 @@ def send_message_api(workspace_id: str):
|
||||
"personalization_name": personalization_name,
|
||||
"workspace_id": ws.workspace_id,
|
||||
})
|
||||
# 立即应用个性化偏好(确保禁用工具分类生效)
|
||||
try:
|
||||
terminal.apply_personalization_preferences(terminal.context_manager.custom_personalization_config)
|
||||
except Exception as exc:
|
||||
debug_log(f"[api_v1] 应用个性化失败: {exc}")
|
||||
except Exception as exc:
|
||||
return jsonify({"success": False, "error": f"自定义参数错误: {exc}"}), 400
|
||||
|
||||
|
||||
@ -216,6 +216,12 @@ def apply_conversation_overrides(terminal: WebTerminal, workspace, conversation_
|
||||
terminal.context_manager.custom_personalization_config = None
|
||||
else:
|
||||
terminal.context_manager.custom_personalization_config = None
|
||||
|
||||
# 应用个性化偏好(含禁用工具分类)到当前终端
|
||||
try:
|
||||
terminal.apply_personalization_preferences(terminal.context_manager.custom_personalization_config)
|
||||
except Exception as exc:
|
||||
debug_log(f"[apply_overrides] 应用个性化失败: {exc}")
|
||||
except Exception as exc:
|
||||
debug_log(f"[apply_overrides] 读取对话元数据失败: {exc}")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user