diff --git a/agents/runner.py b/agents/runner.py index 0a24101..763be3e 100644 --- a/agents/runner.py +++ b/agents/runner.py @@ -1139,7 +1139,7 @@ def _execute_department_head_step( try: models.create_handoff( conn, - pipeline_id=parent_pipeline_id or child_pipeline["id"], + pipeline_id=sub_result.get("pipeline_id") or parent_pipeline_id, task_id=task_id, from_department=dept_name, to_department=next_department, @@ -1216,6 +1216,8 @@ def run_pipeline( allow_write: bool = False, noninteractive: bool = False, initial_previous_output: str | None = None, + parent_pipeline_id: int | None = None, + department: str | None = None, ) -> dict: """Execute a multi-step pipeline of agents. @@ -1258,8 +1260,11 @@ def run_pipeline( # Create pipeline in DB pipeline = None if not dry_run: + effective_route_type = "dept_sub" if parent_pipeline_id else route_type pipeline = models.create_pipeline( - conn, task_id, project_id, route_type, steps, + conn, task_id, project_id, effective_route_type, steps, + parent_pipeline_id=parent_pipeline_id, + department=department, ) # Save PID so watchdog can detect dead subprocesses (KIN-099) models.update_pipeline(conn, pipeline["id"], pid=os.getpid()) diff --git a/web/frontend/src/views/ProjectView.vue b/web/frontend/src/views/ProjectView.vue index 1ae6da9..6cde750 100644 --- a/web/frontend/src/views/ProjectView.vue +++ b/web/frontend/src/views/ProjectView.vue @@ -238,6 +238,24 @@ async function toggleAutocommit() { } } +// Auto-test toggle +const autoTest = ref(false) + +function loadAutoTest() { + autoTest.value = !!(project.value?.auto_test_enabled) +} + +async function toggleAutoTest() { + autoTest.value = !autoTest.value + try { + await api.patchProject(props.id, { auto_test_enabled: autoTest.value }) + if (project.value) project.value = { ...project.value, auto_test_enabled: autoTest.value ? 1 : 0 } + } catch (e: any) { + error.value = e.message + autoTest.value = !autoTest.value + } +} + // Audit const auditLoading = ref(false) const auditResult = ref(null) @@ -389,6 +407,7 @@ async function load() { project.value = await api.project(props.id) loadMode() loadAutocommit() + loadAutoTest() } catch (e: any) { error.value = e.message } finally {