[harness] feat: 新增 GET /agent/runtime 管理员运行状态端点#39
Merged
Conversation
暴露 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 测试
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.
背景
AgentHarness.health()(circuit breaker / tool metrics / scheduler stats / registered agents)此前全在内存、无任何 HTTP 端点暴露,运维无法查看。改动
app/routers/agent_runtime.py:GET /agent/runtime,require_admin鉴权,返回harness.health()瞬时快照;harness 未启动(skipped/failed)返回 503 + 根因app/main.py:注册 routerapp/test/test_agent_runtime_api.py:4 测试(200 started / 503 skipped / 503 failed / 403 非 admin)说明
require_admin(对齐 cloud/knowledge 管理员端点模式)frontend-admin/(独立 Next.js + MUI 应用,Google 后台管理风格),不混入用户端frontend/验证
pytest app/test/test_agent_runtime_api.py-> 4 passedruff check-> All checks passed