Skip to content

[Feature]: 平台运维诊断页:数据库 schema/迁移状态、产物上限、Agent 浏览器镜像状态与预构建 #1185

Open

Description

@linus-liu-web

Problem

本月两次现场都卡在「运维信息只能进容器翻日志 / 连 MySQL 排查」上,页面本身没有任何「当前部署是否健康」的视图:

  1. 产物超过 64KB:一个 SOP clarify 节点产出 84,741 字节的 requirement.md,run_artifacts.content 是 TEXT,写库报 Error 1406 (22001): Data too long for column 'content',节点永久停在 running;页面没有任何错误提示,平台日志里只有一行 put run ...(见 [Bug]: MySQL TEXT artifact exceeds 64 KiB and leaves SOP node running #1092 下补充的复现)。
  2. Agent 浏览器 sidecar 镜像:首次使用时在请求内构建镜像,被 4 分钟 ensure 超时打断,界面误报「Chromium 不可用」;没有任何页面能看镜像是否存在/多大,也无法触发预构建(见 [Bug]: First Agent browser use can be killed by the 4-minute ensure timeout and is reported as "Chromium unavailable" #1160,文档见 docs(deployment): document the Agent browser sidecar image #1172)。
  3. 手工迁移不可见:migrations/ 由运维手工执行,但安装/升级后无法从页面判断哪些对象缺失(生成列、列宽、回填),缺了就直接在页面抛原始 MySQL 错误。这与 [Feature]: 安装和升级时补齐必须的 SQL,避免缺列直接报给用户 #201 描述的是同一类缝隙,[Feature]: 缺少统一的运行时管理(安装 / 版本 / 状态检查 / 设置) #896 也提到运行时缺少统一的状态/设置入口。

现在定位这些问题必须同时会 docker exec + 连 MySQL 查 information_schema,普通 operator 做不到。

Proposed behavior

新增「平台管理 → 运维诊断」只读页(仅管理员可见),每项检查显示 状态(正常 / 警告 / 错误)+ 实测值 + 建议动作,并提供一个只读 API(如 GET /api/platform/diagnostics)供脚本和 CI 复用:

  • 数据库:连接状态、MySQL 版本;关键对象检查 —— run_telemetry.adapter / run_logs.level 生成列是否存在、run_artifacts.content 是否已是 MEDIUMTEXT、runs.input / runs.human_context 的列容量;缺失时列出应执行的 migrations/xxx.sql 文件名和命令。只提示,不自动执行,保持仓库「代码不做迁移、不做 seed」的约定。
  • 产物上限:引擎 maxArtifactBytes(1 MiB)与实际列容量的对比,超限风险提示。
  • Agent 浏览器 sidecar:镜像是否存在、镜像名与大小;提供「预构建」按钮(等价于 agentflow -browser-image)和 npm registry 提示。
  • 执行环境:Docker socket 可用性、AGENTFLOW_ISOLATED_IMAGE 是否存在。
  • 前端遵循现有管理页结构和中英 i18n;检查本身只读,不写库、不改状态。

Scope

Platform — runtime / deployment

Alternatives considered

Checks

  • This proposal does not require organization-specific infrastructure or credentials.
  • I searched existing issues and discussions for similar proposals.

Activity

  1. linus-liu-web commented on Nov 21, 2026

    @linus-liu-web
    Author

    Implemented as #1186 (15 files, +675, mergeable): a read-only 平台管理 → 运维诊断 / Deployment diagnostics page backed by GET /api/platform/diagnostics (platform admins only). It reports:

    • database connectivity + MySQL version;
    • run_telemetry.adapter / run_logs.level generated columns, with scripts/install-schema-extensions.sh as the copyable remediation command;
    • run_artifacts.content capacity vs the engine's 1 MiB artifact limit (TEXT/TINYTEXT warns about the MEDIUMTEXT remedy);
    • Agent browser sidecar image presence with the agentflow -browser-image prebuild command;
    • Docker availability and the configured AGENTFLOW_ISOLATED_IMAGE.

    It only reports and suggests commands; it never runs migrations, matching the repo policy. zh/en copy uses the existing lfT helper and the platform admin tab layout. Tests: go vet on the touched packages, admin/member API test, runtime/browser accessors, engine limit, and a node test for the panel markup — all pass locally; check-public.py passes.

  2. cocofhu00 commented on Nov 21, 2026

    @cocofhu00
    Contributor

    感谢提出这个需求。我的理解是:希望在「平台管理」下增加仅管理员可见的只读运维诊断页和对应只读接口,用来查看数据库关键结构与列容量、产物大小上限、Agent 浏览器镜像以及执行环境是否就绪,并给出建议动作,而不是自动执行迁移。

    已经看到这条 Issue,也看到你在下面补充了与 #1186 相关的说明,会按现有 Issue 排期查看。

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions