Skip to content

[code-review] subagent watchdog never-started Pending failure path: no onComplete/notifyUpdate, upper layers blind to failure #2785

Description

@topcheer

文件: internal/subagent/manager.go L532-551

问题描述
watchdog 对 never-started(Pending 且 goroutineStarted=false)超时 agent:锁内直接翻 StatusFailed + close(sa.done),无 onComplete、无 notifyUpdate,仅 debug.Log。对照 started-but-stuck 路径 L517-528 走 m.Cancel()(内有 notifyUpdate L793),两路径行为不一致。

触发场景
spawn 创建 Pending 条目后 Run goroutine 因异常从未启动,超 inactivityTimeout 后 watchdog 翻 Failed。Wait 阻塞者可解阻塞,但 TUI 与 desktop 的 onComplete 收集方对该 agent 失败零感知——条目一直显示 pending。

修复建议
失败翻转后补发 notifyUpdate(sa)(锁外),保持与 started 路径一致;onComplete 视契约补充。

严重程度: low-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