Plan-based caching with artifact playback in UI
RunStatus now stores: - plan_id, plan_name for linking to execution plan - step_results for per-step execution status - all_outputs for all artifacts from all steps Plan visualization: - Shows human-readable step names from recipe structure - Video/audio artifact preview on node click - Outputs list with links to cached artifacts - Stats reflect actual execution status (completed/cached/pending) Execution: - Step results include outputs list with cache_ids - run_plan returns all outputs from all steps - Support for completed_by_other status Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -222,6 +222,32 @@ def execute_step(
|
||||
# Mark completed
|
||||
complete_task(step.cache_id, worker_id, str(cached_file.path))
|
||||
|
||||
# Build outputs list (for multi-output support)
|
||||
outputs = []
|
||||
if step.outputs:
|
||||
# Use pre-defined outputs from step
|
||||
for output_def in step.outputs:
|
||||
outputs.append({
|
||||
"name": output_def.name,
|
||||
"cache_id": output_def.cache_id,
|
||||
"media_type": output_def.media_type,
|
||||
"index": output_def.index,
|
||||
"path": str(cached_file.path),
|
||||
"content_hash": cached_file.content_hash,
|
||||
"ipfs_cid": ipfs_cid,
|
||||
})
|
||||
else:
|
||||
# Single output (backwards compat)
|
||||
outputs.append({
|
||||
"name": step.name or step.step_id,
|
||||
"cache_id": step.cache_id,
|
||||
"media_type": "video/mp4",
|
||||
"index": 0,
|
||||
"path": str(cached_file.path),
|
||||
"content_hash": cached_file.content_hash,
|
||||
"ipfs_cid": ipfs_cid,
|
||||
})
|
||||
|
||||
# Cleanup temp
|
||||
if output_dir.exists():
|
||||
import shutil
|
||||
@@ -230,10 +256,12 @@ def execute_step(
|
||||
return {
|
||||
"status": "completed",
|
||||
"step_id": step.step_id,
|
||||
"name": step.name,
|
||||
"cache_id": step.cache_id,
|
||||
"output_path": str(cached_file.path),
|
||||
"content_hash": cached_file.content_hash,
|
||||
"ipfs_cid": ipfs_cid,
|
||||
"outputs": outputs,
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user