fix: provision Cloud models after Workspace activation (#2403)

Co-authored-by: dadachann <185672915+dadachann@users.noreply.github.com>
This commit is contained in:
Hyu
2026-08-05 23:26:23 +08:00
committed by GitHub
parent 211710e24c
commit f59343fd5b
4 changed files with 142 additions and 1 deletions
@@ -358,6 +358,7 @@ class DirectoryProjectionService:
await self._reconcile_entitlement_snapshot_set(snapshot)
self._publish_runtime_execution_projection(snapshot.workspaces)
self._request_model_catalog_sync()
self._record_batch_cardinality(
active_workspaces=active_workspace_count,
workspaces=workspace_count,
@@ -466,6 +467,7 @@ class DirectoryProjectionService:
returned.values(),
affected_workspace_uuids=requested,
)
self._request_model_catalog_sync()
self._record_batch_cardinality(
active_workspaces=active_workspace_count,
workspaces=workspace_count,
@@ -475,6 +477,14 @@ class DirectoryProjectionService:
self._record_success()
self._consumer_cursor = batch.cursor
def _request_model_catalog_sync(self) -> None:
"""Wake model provisioning after a committed directory change."""
service = getattr(self.ap, 'cloud_model_catalog_service', None)
request_sync = getattr(service, 'request_sync', None)
if callable(request_sync):
request_sync()
def _publish_runtime_execution_projection(
self,
workspaces: Iterable[DirectoryWorkspace],