From b599b59d44f9ccaaaac31d176a888f157d6fd7f3 Mon Sep 17 00:00:00 2001 From: gilesb Date: Tue, 13 Jan 2026 05:01:26 +0000 Subject: [PATCH] Use IPFS CID as primary output_cid instead of cache_id hash --- legacy_tasks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/legacy_tasks.py b/legacy_tasks.py index afbd9db..5827fdd 100644 --- a/legacy_tasks.py +++ b/legacy_tasks.py @@ -1025,11 +1025,12 @@ def execute_recipe(self, recipe_sexp: str, input_hashes: Dict[str, str], run_id: output_cid = None output_ipfs_cid = None output_path = None + output_cache_id = None # Keep track of cache_id separately if output_step: output_result = step_results.get(output_step.step_id, {}) - output_cid = output_result.get("cid") or output_result.get("cache_id") - output_ipfs_cid = output_result.get("ipfs_cid") + output_cache_id = output_result.get("cache_id") + output_ipfs_cid = output_result.get("cid") # cid should be IPFS CID now output_path = output_result.get("path") # Upload final output to IPFS if not already there @@ -1043,6 +1044,9 @@ def execute_recipe(self, recipe_sexp: str, input_hashes: Dict[str, str], run_id: else: logger.error(f"Failed to upload output to IPFS: {output_path}") + # Use IPFS CID as the primary output identifier + output_cid = output_ipfs_cid + # Fail if output couldn't be uploaded to IPFS if not output_ipfs_cid: logger.error(f"Recipe failed: Could not upload output to IPFS! output_cid={output_cid}, output_path={output_path}")