From 89b2fd3d2eb1ba4b3b1f1597218dc58f74bc49b3 Mon Sep 17 00:00:00 2001 From: giles Date: Tue, 3 Feb 2026 00:00:30 +0000 Subject: [PATCH] Add debug logging to resolve_asset --- tasks/streaming.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/streaming.py b/tasks/streaming.py index 2c545c9..11dad2a 100644 --- a/tasks/streaming.py +++ b/tasks/streaming.py @@ -43,15 +43,19 @@ def resolve_asset(ref: str, actor_id: Optional[str] = None) -> Optional[Path]: Path to the asset file, or None if not found """ global _resolve_loop, _db_initialized + import sys + print(f"RESOLVE_ASSET: ref={ref}, actor_id={actor_id}", file=sys.stderr) cache_mgr = get_cache_manager() # Try as direct CID first path = cache_mgr.get_by_cid(ref) + print(f"RESOLVE_ASSET: get_by_cid({ref}) = {path}", file=sys.stderr) if path and path.exists(): logger.info(f"Resolved {ref[:16]}... as CID to {path}") return path # Try as friendly name if actor_id provided + print(f"RESOLVE_ASSET: trying friendly name lookup, actor_id={actor_id}", file=sys.stderr) if actor_id: import asyncio import database @@ -70,13 +74,17 @@ def resolve_asset(ref: str, actor_id: Optional[str] = None) -> Optional[Path]: _db_initialized = True cid = _resolve_loop.run_until_complete(resolve_friendly_name(actor_id, ref)) + print(f"RESOLVE_ASSET: resolve_friendly_name({actor_id}, {ref}) = {cid}", file=sys.stderr) if cid: path = cache_mgr.get_by_cid(cid) + print(f"RESOLVE_ASSET: get_by_cid({cid}) = {path}", file=sys.stderr) if path and path.exists(): + print(f"RESOLVE_ASSET: SUCCESS - resolved to {path}", file=sys.stderr) logger.info(f"Resolved '{ref}' via friendly name to {path}") return path except Exception as e: + print(f"RESOLVE_ASSET: ERROR - {e}", file=sys.stderr) logger.warning(f"Failed to resolve friendly name '{ref}': {e}") logger.warning(f"Could not resolve asset reference: {ref}")