diff --git a/hypha/apps.py b/hypha/apps.py index 78aaa892..d1eb11ad 100644 --- a/hypha/apps.py +++ b/hypha/apps.py @@ -83,7 +83,6 @@ async def setup_applications_collection(self, overwrite=True, context=None): "config", "services", ], - "collection": [], } await self.artifact_manager.create( "applications", manifest, overwrite=overwrite, stage=False, context=context @@ -520,12 +519,15 @@ async def list_running(self, context: Optional[dict] = None) -> List[str]: async def list_apps(self, context: Optional[dict] = None): """List applications in the workspace.""" try: - apps = await self.artifact_manager.read( + apps = await self.artifact_manager.list_children( prefix="applications", context=context ) - return apps["collection"] + return apps except KeyError: return [] + except Exception as exp: + logger.exception("Failed to list apps: %s", exp) + return [] async def close(self) -> None: """Close the app controller.""" diff --git a/hypha/core/workspace.py b/hypha/core/workspace.py index bcf852cb..0a980c17 100644 --- a/hypha/core/workspace.py +++ b/hypha/core/workspace.py @@ -1248,12 +1248,12 @@ async def _launch_application_for_service( "built-in", ], f"Invalid service id: {service_id}" - app_collection = await self._artifact_manager.read( + applications = await self._artifact_manager.list_children( "applications", context={"ws": workspace, "user": user_info.model_dump()} ) applications = { item["id"]: ApplicationArtifact.model_validate(item) - for item in app_collection["collection"] + for item in applications } if app_id not in applications: raise KeyError(