Skip to content

Commit 668a3f2

Browse files
committed
fix: ensure blocking behavior in catalog entity resolution
- Updated the `resolve_tracked_catalog_entity_ids` function call in `TierManager` to include the `blocking=True` parameter, ensuring that the catalog resolution process waits for completion. - Enhanced the handling of empty catalog responses in `resolve_tracked_catalog_entity_ids` to clarify that an empty list indicates a rebuild in progress rather than zero tracked tools. - This update aims to improve the reliability of catalog entity resolution and enhance clarity in tool tracking behavior.
1 parent 78fcc04 commit 668a3f2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/cyt/tiers/adapters/tools.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ def resolve_tracked_catalog_entity_ids(
7777
from cyt.tools.master_catalog import get_master_tool_catalog
7878

7979
catalog = get_master_tool_catalog(config, blocking=blocking)
80-
if catalog is None:
80+
# Empty list means SWR miss / rebuild in flight — not "zero tracked tools".
81+
if catalog is None or not catalog:
8182
return None
8283
ids = {
8384
entity_id

‎src/cyt/tiers/manager.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def purge_inactive_tool_sources(self, config: dict[str, Any]) -> None:
307307

308308
scoped = self._workspace_scoped_config(config)
309309
allowed = configured_tool_catalog_sources(scoped)
310-
catalog_entity_ids = resolve_tracked_catalog_entity_ids(scoped)
310+
catalog_entity_ids = resolve_tracked_catalog_entity_ids(scoped, blocking=True)
311311
scope_key = (allowed, catalog_entity_ids)
312312
if self._purged_tool_scope == scope_key:
313313
return

0 commit comments

Comments
 (0)