Use IPFS CID as primary output_cid instead of cache_id hash

This commit is contained in:
gilesb
2026-01-13 05:01:26 +00:00
parent cf83952a19
commit b599b59d44

View File

@@ -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}")