Skip to content

Commit b69c5f8

Browse files
committed
refactor(agui): remove health check endpoint and update tests
The health check endpoint was removed from the AGUI protocol handler as it's no longer needed. All related test cases have been updated to reflect the new health check location at the root path. BREAKING CHANGE: The /ag-ui/agent/health endpoint has been removed and health checks are now available at /health 移除 AGUI 协议的健康检查端点并更新测试 AGUI 协议处理器中的健康检查端点已被移除, 因为它不再需要。所有相关测试用例都已更新以反映 新健康检查位置在根路径。 重大变更:/ag-ui/agent/health 端点已被移除, 健康检查现在可在 /health 路径获取 Change-Id: I7afd3abc03a90ec0e9ab989529197b6ce158ba76 Signed-off-by: OhYee <oyohyee@oyohyee.com>
1 parent 08e22b5 commit b69c5f8

File tree

4 files changed

+2
-23
lines changed

4 files changed

+2
-23
lines changed

agentrun/server/agui_protocol.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,6 @@ async def run_agent(request: Request):
206206
headers=sse_headers,
207207
)
208208

209-
@router.get("/health")
210-
async def health_check():
211-
"""健康检查端点"""
212-
return {"status": "ok", "protocol": "ag-ui", "version": "1.0"}
213-
214209
return router
215210

216211
async def parse_request(

tests/unittests/integration/langchain/test_agent_invoke_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _start_server(app: FastAPI) -> tuple:
100100
base_url = f"http://127.0.0.1:{port}"
101101
for i in range(50):
102102
try:
103-
httpx.get(f"{base_url}/ag-ui/agent/health", timeout=0.2)
103+
httpx.get(f"{base_url}/health", timeout=0.2)
104104
break
105105
except Exception:
106106
if i == 49:

tests/unittests/integration/test_langchain_agui_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ async def invoke_agent(request: AgentRequest):
671671
base_url = f"http://127.0.0.1:{port}"
672672
for i in range(50):
673673
try:
674-
httpx.get(f"{base_url}/ag-ui/agent/health", timeout=0.2)
674+
httpx.get(f"{base_url}/health", timeout=0.2)
675675
break
676676
except Exception:
677677
if i == 49:

tests/unittests/server/test_agui_protocol.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,6 @@ def get_client(self, invoke_agent):
4343
server = AgentRunServer(invoke_agent=invoke_agent)
4444
return TestClient(server.as_fastapi_app())
4545

46-
@pytest.mark.asyncio
47-
async def test_health_check(self):
48-
"""测试健康检查端点"""
49-
50-
def invoke_agent(request: AgentRequest):
51-
return "Hello"
52-
53-
client = self.get_client(invoke_agent)
54-
response = client.get("/ag-ui/agent/health")
55-
56-
assert response.status_code == 200
57-
data = response.json()
58-
assert data["status"] == "ok"
59-
assert data["protocol"] == "ag-ui"
60-
assert data["version"] == "1.0"
61-
6246
@pytest.mark.asyncio
6347
async def test_value_error_handling(self):
6448
"""测试 ValueError 处理"""

0 commit comments

Comments
 (0)