Save run output to user's media collection

When a recipe run completes, save the output to the user's media
with description and source tracking.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-11 21:56:59 +00:00
parent 95ffe9fa69
commit c6fadea090

View File

@@ -399,6 +399,18 @@ def execute_dag(self, dag_json: str, run_id: str = None) -> dict:
ipfs_cid=output_ipfs_cid,
actor_id=actor_id,
)
# Save output as media for the user
if actor_id:
await database.save_item_metadata(
content_hash=output_hash,
actor_id=actor_id,
item_type="media",
description=f"Output from recipe: {recipe_name}",
source_type="recipe",
source_note=f"run_id: {run_id}",
)
# Clean up pending run
if pending:
await database.complete_pending_run(run_id)