Skip to content

[harness] feat: 新增 GET /agent/runtime 管理员运行状态端点#39

Merged
atoncooper merged 1 commit into
mainfrom
feat/agent-runtime-status
Jul 23, 2026
Merged

[harness] feat: 新增 GET /agent/runtime 管理员运行状态端点#39
atoncooper merged 1 commit into
mainfrom
feat/agent-runtime-status

Conversation

@atoncooper

Copy link
Copy Markdown
Owner

背景

AgentHarness.health()(circuit breaker / tool metrics / scheduler stats / registered agents)此前全在内存、无任何 HTTP 端点暴露,运维无法查看。

改动

  • 新增 app/routers/agent_runtime.pyGET /agent/runtimerequire_admin 鉴权,返回 harness.health() 瞬时快照;harness 未启动(skipped/failed)返回 503 + 根因
  • app/main.py:注册 router
  • app/test/test_agent_runtime_api.py:4 测试(200 started / 503 skipped / 503 failed / 403 非 admin)

说明

  • 仅后端端点 + 测试,未碰 chat 链路,无回归风险
  • 端点为瞬时快照,非持久化历史
  • 鉴权复用 require_admin(对齐 cloud/knowledge 管理员端点模式)
  • 前端管理面板将作为独立 PR 跟进:frontend-admin/(独立 Next.js + MUI 应用,Google 后台管理风格),不混入用户端 frontend/

验证

暴露 AgentHarness.health() 全局运行快照(circuit breaker / tool metrics /
scheduler stats / registered agents),require_admin 鉴权,未启动返回 503 +
根因。为 frontend-admin 运维面板提供数据源。

- app/routers/agent_runtime.py: GET /agent/runtime
- app/main.py: 注册 router
- app/test/test_agent_runtime_api.py: 200(started)/503(skipped)/503(failed)/403 测试
@atoncooper
atoncooper merged commit 61e2018 into main Jul 23, 2026
4 checks passed
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.

1 participant