Skip to content

[code-review] subagent notifyUpdate Manager-level global throttle: one streaming agent suppresses all other agents terminal-state notifications #2784

Description

@topcheer

文件: internal/subagent/manager.go L1343-1363(notifyUpdate),m.lastNotify L401

问题描述(与已关闭 #136 不同:#136 是 watermark 无条件更新,本件是节流作用域跨 agent 且终态无豁免)
m.lastNotify 是 Manager 级单一时间戳,无 per-agent 区分。任一 agent 的通知会把所有其他 agent 的 onUpdate 抑制在 100ms 窗口外。Complete 的终态通知(L1049)与高频流式 Notify 走同一路径,无终态豁免。

触发场景
agent A 大输出流式(每 token 触发 notifyUpdate,持续刷新 watermark)→ agent B 同时刻 Complete → B 的 Completed 终态 onUpdate 落在 A 上次通知后 <100ms 被跳过。被吞的恰是低频终态事件时无下一个事件兜底——Complete 后通常不再有活动,B 的终态在 UI 上长时间不刷新。

修复建议
per-agent 节流(map[agentID]time.Time),或对终态状态转换(Completed/Failed/Cancelled)豁免节流。

严重程度: medium

来源: cron-1 深度审查,独立复核 subagent 确认

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions