Repository navigation
feat(dashboard): 增加运行监控页 - #409
Merged
Merged
Conversation
xiongz-c
force-pushed
the
codex/resource-monitor-plan
branch
from
July 9, 2026 02:48
abab537 to
f6eb294
Compare
xiongz-c
marked this pull request as ready for review
July 9, 2026 07:00
xiongz-c
force-pushed
the
codex/resource-monitor-plan
branch
from
July 9, 2026 07:20
45a41f3 to
118efcb
Compare
deepcoldy
approved these changes
Jul 9, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
二次 review 已完成。重点检查了资源归因、/proc fallback、ring buffer 外层历史保留、采样服务/API 鉴权;已补充一个 follow-up 修复,收敛 tracked session 历史 Map 并用 procStart 校验 PID marker,相关测试与 build 已通过。
deepcoldy
pushed a commit
that referenced
this pull request
Jul 10, 2026
将 dashboard 迁移到 React(esbuild 按页面分包),按统一 UI 规范重构工作台/会话/洞察/工作流/群组/定时/白板/角色/Bot配置/Skills/团队/Webhook/全局设置等页面,沉淀 UI 基准规范与通用组件。含 review 修复(locate 图标/team capability/timezone/DropdownMenu/floating-scrollbars/insights/bot-defaults/legacy-workflow/替身编辑等)+ 集成 master 新功能(#404 会话筛选列/#405 监控室/#409 运行监控页/#412 lark-cli状态+飞书QR/#401 替身/#420 agentbuddy 源)。build 绿、全量 unit 0 非环境失败。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景 / 动机
Botmux 经常运行在远端 Linux 开发机上,同一台机器里可能同时存在多个 bot、多个 live 会话、worker 进程和底层 AI CLI。出现卡顿、内存上涨或会话堆积时,使用者首先需要判断的是“当前运行环境是否健康、容量风险在哪里”:宿主机资源是否紧张,botmux 自身是否异常上涨,daemon 是否在线,会话是否堆积,资源是否能关联到具体 bot / 会话。
这些问题过去需要离开 Dashboard 到机器上用 shell 工具排查,Dashboard 缺少一个面向实时排障的第一现场视图。本 PR 将 Dashboard 的「监控」定义为运行健康入口,而不是 AI 行为分析入口:监控回答“现在是否健康、哪里有容量风险”,洞察继续回答“AI CLI 做了什么、行为质量和长期模式怎样”。
本版是运行监控 v1,只做只读观察;不新增 kill、restart、cleanup 等操作能力,也不新增长期落盘或数据库依赖。
改动
#/monitoring,展示运行健康、资源压力、趋势、会话压力、Bot 运行表和当前会话资源表。/proc资源采样,采集宿主机 CPU / Memory / load,以及进程 RSS、CPU tick delta。/api/resources/current与/api/resources/history,current 返回全量 live session 当前值,history 只返回保留趋势的数据集。默认值 / 兼容性依据
~/.botmux、usage ledger、workflow runs、PM2 log 或新数据库。/proc不可用时资源采样返回 unsupported;运行健康仍尽量展示 daemon/session 状态。测试覆盖
/procparser:覆盖 CPU tick、idle tick、loadavg、meminfo、带括号/空格的 process stat。验证
pnpm vitest run test/resource-monitor-procfs.test.ts test/resource-monitor-ring-buffer.test.ts test/resource-monitor-runtime.test.ts test/resource-monitor-attribution.test.ts test/resource-monitor-top-selector.test.ts test/dashboard-resource-service.test.ts test/dashboard-resource-api.test.ts test/dashboard-resource-row.test.ts test/dashboard-monitoring-ui.test.ts test/dashboard-i18n.test.ts test/dashboard-route-smoke.test.tspnpm buildgit diff --check影响范围
/proc并在内存中维护短期趋势,不新增外部服务、数据库或长期磁盘堆积。