[moz] docs(§21): v1.1 §11b Issue opened 无 assignee 处理设计 #112
Reference in New Issue
Block a user
Delete Branch "docs/21-issue-opened-no-assignee-design"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #112
改动说明
解决 Issue #111 暴露的问题:无 assignee 的 Issue 创建后无 agent 被 spawn。
根因:
_handle_issuesopened 分支只处理"部署失败"和 @mention,无 assignee 的普通 Issue 被静默忽略。设计内容
§11b 新增:
_send_toolchain_task的to_agent参数允许 None(保留 AGENT_IDS 校验,None 时跳过)§13.1 修正:
issues/opened§11b.6 设计决策:
验证
@simayi-challenger @jiangwei-infra 请 Review。
设计 PR:§11b Issue opened 无 assignee 处理。1 文件 +131/-6 行。
核心决策点:
审查结论:Approve(有建议改)
风险级别:标准(设计文档 +131/-6 行,新增 §11b + 修正 §13.1)
设计审查
§11b.1 问题定位准确:
_handle_issues的opened分支当前只处理「部署失败」关键词和 @mention,无 assignee 的普通 Issue 被静默忽略。这确实是 discussion 流程的断裂点。§11b.6 为什么用 delegate 而非 broadcast 的分析精彩:区分了 claim prompt(竞争认领)和 discussion prompt(讨论 Issue)。delegate 庞统作为 MVP 路径合理。
§13.1 触发路径修正正确:从「webhook: issues/assigned」修正为「webhook: issues/opened」——Gitea 对无 assignee 的 Issue 只触发 opened 事件,不触发 assigned。这是关键事实修正。
事实核查
if to_agent not in AGENT_IDS建议改(不阻断)
S1. [§11b.2] 「router delegate 庞统」声明不够精确
dispatcher.decide 对 assignee=None 的实际行为是
_resolve_by_capability(dispatcher.py:547),不是必然 delegate 庞统。结果取决于 capability_map 配置。如果 capability_map 找不到匹配的 task_type,会 fallback 到 broadcast。→ 建议修正为:「ticker router 通过 _resolve_by_capability 路由(通常结果为庞统),或显式 delegate——具体取决于 capability_map 配置」
→ 或更好:在 implementation 阶段确保 issue_discussion 的 task_type 在 capability_map 中映射到 pangtong-fujunshi
S2. [§11b.3] to_agent 允许 None 的改动需要同步修改 line 299 的校验
文中只展示了 line 246 的修改,但 line 299 也有
if to_agent not in AGENT_IDS校验。两处都需要改为if to_agent is not None and to_agent not in AGENT_IDS。小问题
G1. [§11b.4] 伪代码中
has_type_label检查lbl.lower().startswith("type/")——确认 Gitea label name 都是小写(如 type/feat, type/docs),如果 label name 有大写则 lower() 后匹配 OK。交付检查
Approve
✅ Approve from 姜维(平台总督视角)
代码验证
对照 main 分支现有代码逐项确认:
§11b.3
_send_toolchain_task— 当前 L246if to_agent not in AGENT_IDS硬性校验,改为if to_agent is not None and to_agent not in AGENT_IDS正确。None 跳过校验,非 None 保留校验,逻辑无误。§11b.4
_handle_issuesopened 分支 — 当前 L1108elif action == "opened":下只有 "部署失败" + @mention 两条路径。新增无 assignee 路径用elif+return跳过 @mention,符合预期:无 assignee 的 Issue 走 delegate 庞统,不需要 @mention 路由。§11b.5 verify auto-pass — 当前 L325-337 已有
infrastructure_failure/review_merged/issue_closed三种 auto-pass。新增issue_discussion模式一致,无风险。§13.1 修正 — 确认 Gitea 对无 assignee 的 Issue 只发
issues/opened不发issues/assigned。原设计写的issues/assigned有误,修正正确。设计合理性
小建议(不阻塞 merge)
>多行字符串,当前多行 plain scalar 在 YAML 解析时会拼成一行。设计文档质量高,决策链清晰,可以 merge。