kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-17 16:01:51 +02:00
parent 6eea439c16
commit 7027252a84
3 changed files with 12 additions and 18 deletions

View file

@ -1090,15 +1090,6 @@ def _execute_department_head_step(
role = step["role"]
dept_name = role.replace("_head", "")
# Create child pipeline in DB
child_pipeline = models.create_pipeline(
conn, task_id, project_id,
route_type="dept_sub",
steps=sub_pipeline,
parent_pipeline_id=parent_pipeline_id,
department=dept_name,
)
# Build initial context for workers: dept head's plan + artifacts
dept_plan_context = json.dumps({
"department_head_plan": {
@ -1109,12 +1100,16 @@ def _execute_department_head_step(
}, ensure_ascii=False)
# Run the sub-pipeline (noninteractive=True — Opus already reviewed the plan)
# pass parent_pipeline_id and department so run_pipeline creates the child
# pipeline with correct attributes (route_type='dept_sub') — no double create
sub_result = run_pipeline(
conn, task_id, sub_pipeline,
dry_run=False,
allow_write=allow_write,
noninteractive=True,
initial_previous_output=dept_plan_context,
parent_pipeline_id=parent_pipeline_id,
department=dept_name,
)
# Extract decisions from sub-pipeline results for handoff