Skip to content

Add subagent monitoring dashboard section#47

Open
0x-latent wants to merge 1 commit intoTianyiDataScience:mainfrom
0x-latent:feature/subagent-monitoring
Open

Add subagent monitoring dashboard section#47
0x-latent wants to merge 1 commit intoTianyiDataScience:mainfrom
0x-latent:feature/subagent-monitoring

Conversation

@0x-latent
Copy link
Copy Markdown

Summary

  • New "Subagents" dashboard tab showing subagent tree, status overview, and exception highlights
  • Build subagent tree from existing session execution chain data (parent/child relationships)
  • Extend commander alerts with HAS_SUBAGENT_ERRORS and HAS_DEEP_CHAIN warnings
  • Add SUBAGENT_MAX_DEPTH_WARN config (default 5, env var override)
  • Bilingual UI (en/zh), consistent with existing styling

Changed files

File Change
src/runtime/subagent-tree.ts New — tree builder + stats inference
src/types.ts Add SubagentTreeStats, extend ReadModelSnapshot and exception codes
src/config.ts Add SUBAGENT_MAX_DEPTH_WARN threshold
src/adapters/openclaw-readonly.ts Populate subagentStats in snapshot
src/runtime/commander.ts Subagent error and deep chain alerts
src/ui/server.ts New nav section, tree renderer, CSS

Test plan

  • All 89 existing tests pass
  • TypeScript compiles with no errors
  • Verify subagent tree renders correctly with live session data
  • Verify exception alerts trigger on error/deep chain scenarios

🤖 Generated with Claude Code

Build a subagent tree from session execution chains and display it
as a new "Subagents" dashboard tab with status overview, tree view,
and exception highlights. Extend commander alerts for subagent errors
and deep chain warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TianyiDataScience
Copy link
Copy Markdown
Owner

谢谢你做这条 PR,也谢谢你把 subagent / spawn 关系整理成可视化页面。

我这边已经本地拉下来跑过了:

  • npm run build
  • npm test
  • npm run smoke:ui

这条 PR 本身不是“做坏了”,方向也有价值,尤其是:

  • parent / child 关系整理
  • 深链和异常节点提示
  • 用树形方式看 spawn 结构

我现在先不直接合,主要是两个原因:

  1. 这条分支的基线已经比较旧了
    它是从比较早的主线切出来的,和现在的 main 已经分开一段时间了。当前主线后面已经加入了协作页、跨会话通信、性能收敛等几轮演进,所以这条 PR 现在不是“直接 merge 就行”的状态。

  2. 它和我们现在的协作页在信息架构上有重复,也有冲突
    这条 PR 主要聚焦的是 spawn / parent-child tree,这一点本身没问题。
    但当前主线里的“协作”已经不只看父子会话,还覆盖了已验证的跨会话通信(比如 Main ⇄ Pandas)。
    如果现在再直接新增一个独立的 Subagents 一级页面,用户会同时面对两个都在讲 agent 关系的页面,心智上会比较容易打架。

不过我觉得这条 PR 里最有价值的部分,完全值得继续往前走。
如果你愿意继续做,我会更推荐把这些能力往当前已经有的“协作”页面里收,而不是保留成一个新的一级页面。比如:

  • 把 parent / child tree 作为协作页的一种补充视图
  • 把深链、异常子节点、阻塞节点做成协作页里的摘要或告警
  • 把它作为“协作证据”的一部分,而不是单独拆出一个平行模块

所以我现在的判断不是“这个想法不值得做”,而是:

  • 它更适合后面被吸收到现有协作体系里
  • 而不是以现在这版、现在这个入口结构直接合进主线

这条 PR 里的思路我认可,也谢谢你把它做到了能跑、能看的程度。
如果你愿意继续沿着“协作页增强”的方向推进,我很愿意再看一轮。

@TianyiDataScience
Copy link
Copy Markdown
Owner

谢谢你做这条 PR。subagent monitoring 这个方向是有价值的,尤其是对复杂执行链路的可见性帮助很大。

我这次先没有直接 merge,主要是因为它现在同时碰了 src/config.tssrc/types.tssrc/ui/server.ts 这些主干热区,和最新 main 也已经是 dirty 状态。我不想把监控视图和最近的主干演进硬揉在一起。

如果你愿意继续推进,我会建议先 rebase 到最新 main;如果还能把数据层和 UI 层拆开,会更容易往前合。

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants