From a0d2328b01f36eb5af9337af22370663bd08c1ca Mon Sep 17 00:00:00 2001 From: gilesb Date: Fri, 9 Jan 2026 11:51:26 +0000 Subject: [PATCH] Register recipes with proper naming and tags When auto-registering input assets from a run, detect recipes and give them appropriate names (recipe-{hash}) and tags (auto-registered, input, recipe) instead of generic input names. Co-Authored-By: Claude Opus 4.5 --- server.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/server.py b/server.py index 5dad17d..51e8c05 100644 --- a/server.py +++ b/server.py @@ -2071,14 +2071,20 @@ async def record_run(req: RecordRunRequest, user: User = Depends(get_required_us # Register input assets (if not already on L2) for inp in input_infos: if not inp["existing_asset"]: - # Create new input asset - input_name = f"input-{inp['content_hash'][:16]}" + # Create new input asset with appropriate name based on type + media_type = inp["media_type"] + if media_type == "recipe": + input_name = f"recipe-{inp['content_hash'][:16]}" + tags = ["auto-registered", "input", "recipe"] + else: + input_name = f"input-{inp['content_hash'][:16]}" + tags = ["auto-registered", "input"] input_asset = { "name": input_name, "content_hash": inp["content_hash"], "ipfs_cid": inp["ipfs_cid"], - "asset_type": inp["media_type"], - "tags": ["auto-registered", "input"], + "asset_type": media_type, + "tags": tags, "metadata": {"auto_registered_from_run": req.run_id}, "owner": user.username, "created_at": now