refactor(agent, shipping): 简化代理模型并完善订单抽取业务

- 移除 Agent 的 exposure_mode 与 internal_executor 相关逻辑,清理关联的过滤、序列化代码
- 删除废弃的 AgentRuntimeBinding 模型及其依赖
- 新增订单抽取上传批次、请求快照等数据库迁移与业务逻辑
- 修复附件完整性检测、订单抽取状态映射问题
- 更新多语言错误文案与前端单元测试配置
- 清理平台配置中不再使用的暴露模式配置
This commit is contained in:
hugo committed 2026-07-28 20:25:48 +08:00
1 parent 1f3ecb87b7
commit 61ac6403c4
159 files changed
+12883 -5099

No files matched your search

@@ -20,12 +20,7 @@ def compute_dashboard_summary() -> dict:
agent_count、user_count、total_conversations、avg_score。
"""
total_users = db.session.query(func.count(User.id)).scalar() or 0
active_agents = (
db.session.query(func.count(Agent.id))
.filter(Agent.is_active.is_(True), Agent.exposure_mode == 'workspace')
.scalar()
or 0
)
active_agents = db.session.query(func.count(Agent.id)).filter_by(is_active=True).scalar() or 0
total_conversations = db.session.query(func.count(ChatLog.id)).scalar() or 0
avg_score = db.session.query(func.avg(Feedback.score)).scalar()
avg_score = round(float(avg_score), 1) if avg_score else 0.0
@@ -44,13 +39,7 @@ def compute_dashboard_badges() -> dict:
pending_approvals、pending_requests。
"""
pending_approvals = db.session.query(func.count(User.id)).filter_by(status='pending').scalar() or 0
pending_requests = (
db.session.query(func.count(PermissionRequest.id))
.join(Agent, Agent.id == PermissionRequest.agent_id)
.filter(PermissionRequest.status == 'pending', Agent.exposure_mode == 'workspace')
.scalar()
or 0
)
pending_requests = db.session.query(func.count(PermissionRequest.id)).filter_by(status='pending').scalar() or 0
return {
'pending_approvals': pending_approvals,
'pending_requests': pending_requests,