auto-sync: 2026-06-08 08:51:12
Deploy / ci (push) Waiting to run
Deploy / deploy (push) Blocked by required conditions
Deploy / notify-deploy-failure (push) Blocked by required conditions

This commit is contained in:
cfdaily
2026-06-08 08:51:12 +08:00
parent 8bd364055c
commit 83fb270e2a
2 changed files with 35 additions and 34 deletions
+2 -6
View File
@@ -10,14 +10,10 @@ from typing import Optional
from src.blackboard.models import Task
from src.blackboard.operations import Blackboard
from src.config.agents import AGENT_IDS
logger = logging.getLogger(__name__)
# 有效 Agent ID 集合(用于校验通知目标)
_VALID_AGENT_IDS = frozenset({
"pangtong-fujunshi", "simayi-challenger", "zhangfei-dev",
"guanyu-dev", "zhaoyun-data", "jiangwei-infra",
})
# 邮件通知正文模板(统一模板,包含所有可能的失败原因和建议)
_NOTIFY_TEMPLATE = """你的邮件投递失败了。
@@ -76,7 +72,7 @@ def notify_mail_failed(db_path: Path, original_mail_id: str,
# 发件人不是有效 Agent(如 system)→ 通知庞统代处理,不触发广播
target_agent = from_agent
if from_agent not in _VALID_AGENT_IDS:
if from_agent not in AGENT_IDS:
logger.warning("Mail %s: sender '%s' is not a valid agent, routing failure notice to pangtong-fujunshi",
original_mail_id, from_agent)
target_agent = "pangtong-fujunshi"