feat(app): 移除内置agents并添加CORS支持和技能上传优化

移除了agents/registry.json中的所有内置agents配置,将agents数组清空。
为web应用添加了CORS中间件支持,允许指定的前端地址跨域访问。
重构了技能上传功能,增加了LLM重写机制,自动规范化上传的技能格式。
新增了工具名称提取逻辑,从技能正文中自动识别Required Tools段落。
更新了技能学习候选者和草稿的载荷结构,添加评估报告统计信息。
修改了意图路由技能的说明,改进任务状态管理逻辑。
This commit is contained in:
2026-06-12 13:25:20 +08:00
parent fc9fd93c36
commit 8aeb97a5fc
76 changed files with 3382 additions and 553 deletions

View File

@ -99,7 +99,11 @@ def provision_user_file_minio_settings(
policy = _namespace_policy(bucket=cfg.bucket, namespace=namespace)
admin.policy_add(policy_name, policy=policy)
admin.attach_policy(policies=[policy_name], user=access_key)
try:
admin.attach_policy(policies=[policy_name], user=access_key)
except Exception as exc:
if not _is_policy_attach_already_applied(exc):
raise
except Exception as exc:
raise MinIOProvisioningError(f"MinIO user file provisioning failed: {exc}") from exc
@ -304,6 +308,15 @@ def _is_absent_error(exc: Exception) -> bool:
return any(marker in text for marker in absent_markers)
def _is_policy_attach_already_applied(exc: Exception) -> bool:
text = _safe_error_text(exc)
return (
"XMinioAdminPolicyChangeAlreadyApplied" in text
or "specified policy change is already in effect" in text.lower()
or "policy update has no net effect" in text.lower()
)
def _safe_error_text(exc: object) -> str:
text = str(exc).strip()
return text or exc.__class__.__name__