diff --git a/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py b/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py index ba6e9f5ddd..d1baad5561 100644 --- a/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py +++ b/python/packages/ag-ui/agent_framework_ag_ui/_endpoint.py @@ -91,4 +91,4 @@ async def event_generator(): ) except Exception as e: logger.error(f"Error in agent endpoint: {e}", exc_info=True) - return {"error": str(e)} + return {"error": "An internal error has occurred."} diff --git a/python/packages/ag-ui/tests/test_endpoint.py b/python/packages/ag-ui/tests/test_endpoint.py index b5846bbbf8..1ae364f818 100644 --- a/python/packages/ag-ui/tests/test_endpoint.py +++ b/python/packages/ag-ui/tests/test_endpoint.py @@ -154,7 +154,7 @@ async def test_endpoint_error_handling(): assert response.status_code == 200 content = json.loads(response.content) assert "error" in content - assert "Expecting value" in content["error"] + assert content["error"] == "An internal error has occurred." async def test_endpoint_multiple_paths():