Fix input preview hash -> cid key mismatch

Template uses inp.cid and input.cid but router created previews with
'hash' key. Fixed both input_previews and run_inputs to use 'cid'.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-12 12:27:05 +00:00
parent 2cc7d88d2e
commit 991db29e27
2 changed files with 29 additions and 2 deletions

View File

@@ -278,7 +278,7 @@ async def get_run(
except Exception:
pass
run_inputs.append({
"hash": input_hash,
"cid": input_hash,
"name": f"Input {i + 1}",
"media_type": media_type,
})
@@ -407,7 +407,7 @@ async def list_runs(
inputs = run.get("inputs", [])
if isinstance(inputs, list):
for input_hash in inputs[:3]:
preview = {"hash": input_hash, "media_type": None}
preview = {"cid": input_hash, "media_type": None}
try:
cache_path = cache_manager.get_by_cid(input_hash)
if cache_path and cache_path.exists():