Fix run recipe: optional fields in RunStatus, list->dict nodes

- Made recipe and inputs optional in RunStatus model
- Convert DAG nodes from list format to dict format when running recipes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-11 17:50:36 +00:00
parent b57745098e
commit 970faa3fa0
2 changed files with 12 additions and 2 deletions

View File

@@ -220,6 +220,16 @@ async def run_recipe(
dag_copy = json.loads(json.dumps(recipe_dag)) # Deep copy
nodes = dag_copy.get("nodes", {})
# Convert nodes from list to dict if needed
if isinstance(nodes, list):
nodes_dict = {}
for node in nodes:
node_id = node.get("id")
if node_id:
nodes_dict[node_id] = node
nodes = nodes_dict
dag_copy["nodes"] = nodes
# Map input names to content hashes
for input_name, content_hash in req.inputs.items():
if input_name in nodes:

View File

@@ -41,8 +41,8 @@ class RunRequest(BaseModel):
class RunStatus(BaseModel):
run_id: str
status: str
recipe: str
inputs: List[str]
recipe: Optional[str] = None
inputs: Optional[List[str]] = None
output_name: Optional[str] = None
created_at: Optional[str] = None
completed_at: Optional[str] = None