From 3f9b6975a5b21390d56691f6560aee345be13012 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Fri, 29 May 2026 21:10:38 +0800 Subject: [PATCH] auto-sync: 2026-05-29 21:10:38 --- src/api/mail_routes.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/api/mail_routes.py b/src/api/mail_routes.py index d5483ba..17eb216 100644 --- a/src/api/mail_routes.py +++ b/src/api/mail_routes.py @@ -19,6 +19,23 @@ from src.blackboard.operations import Blackboard from src.blackboard.queries import Queries from src.utils import get_data_root + +def _get_valid_agents() -> set: + """从 config/default.yaml 读取有效 Agent ID 列表""" + config_path = Path(__file__).parent.parent / "config" / "default.yaml" + if config_path.exists(): + import yaml + try: + with open(config_path) as f: + cfg = yaml.safe_load(f) + profiles = cfg.get("daemon", {}).get("agent_profiles", {}) + if profiles: + return set(profiles.keys()) + except Exception: + pass + # fallback:硬编码 + return {"zhangfei-dev", "guanyu-dev", "zhaoyun-data", "jiangwei-infra", "pangtong-fujunshi", "simayi-challenger"} + router = APIRouter(prefix="/api/mail", tags=["mail"]) MAIL_PROJECT_ID = "_mail"