fix: 修复前台4项问题(MCP列举/微信技能上限/Word资产栏/技能MCP反馈) + 同步容器live状态
- #549 平台MCP列举: 注入全量已启用MCP清单, AI不再凭空编造 - #550 微信Bot技能自动发现上限 15->300 - #551 知识库Word文档同步资产后Word栏可见 + 双向删除同步(assets/knowledge级联软删) - #552 对话反馈实际使用的技能/MCP(used_mcp字段), 含历史消息序列化 - 同步容器内其他未提交live改动(im_bot_platform/TokenDashboard/WechatBot/ChatPage)
This commit is contained in:
1 parent
7fb7c07f57
commit
1578d68f95
10 files changed
+1927
-1719
No files matched your search
@@ -368,6 +368,19 @@ def delete_asset(
|
||||
asset.status = "deleted"
|
||||
asset.updated_at = datetime.now()
|
||||
|
||||
# 若资产由知识库文档同步而来,双向删除对应的知识库文档
|
||||
if asset.knowledge_doc_id:
|
||||
try:
|
||||
kb_doc = db.query(KnowledgeDocument).filter(KnowledgeDocument.id == asset.knowledge_doc_id).first()
|
||||
if kb_doc:
|
||||
kb = db.query(KnowledgeBase).filter(KnowledgeBase.id == kb_doc.knowledge_base_id).first()
|
||||
if kb:
|
||||
kb.document_count = max(0, (kb.document_count or 0) - 1)
|
||||
kb.updated_at = datetime.now()
|
||||
db.delete(kb_doc)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
LogService.log_operation(
|
||||
user_id=current_user.id, username=current_user.username, action="delete",
|
||||
target="asset", target_id=asset.id,
|
||||
|
||||
Reference in new issue
Block a user