refactor: 清理代码质量和移除未使用文件

- 移除未使用的导入语句和变量
- 修复代码风格问题(空格、格式化等)
- 删除备份文件和测试文件
- 改进异常处理链式调用
- 添加权限系统数据库模型和配置
- 更新版本号至6.4.4
- 优化SQL查询使用正确的布尔表达式
This commit is contained in:
雅诺狐
2025-08-24 22:11:20 +08:00
parent 702112fdc4
commit f308adcf5b
26 changed files with 1664 additions and 677 deletions

View File

@@ -214,7 +214,7 @@ class ActionDiagnostics:
raise Exception("注册失败")
except Exception as e:
raise Exception(f"手动注册no_reply Action失败: {e}")
raise Exception(f"手动注册no_reply Action失败: {e}") from e
def run_full_diagnosis(self) -> Dict[str, Any]:
"""运行完整诊断"""

View File

@@ -131,7 +131,7 @@ class AsyncMemoryQueue:
await task.callback(None)
else:
task.callback(None)
except:
except Exception:
pass
async def _handle_store_task(self, task: MemoryTask) -> Any:

View File

@@ -271,7 +271,7 @@ class VectorInstantMemoryV2:
return f"{int(diff/3600)}小时前"
else:
return f"{int(diff/86400)}天前"
except:
except Exception:
return "时间格式错误"
async def get_memory_for_context(self, current_message: str, context_size: int = 3) -> str:
@@ -318,7 +318,7 @@ class VectorInstantMemoryV2:
try:
result = self.collection.count()
stats["total_messages"] = result
except:
except Exception:
stats["total_messages"] = "查询失败"
return stats