kin: KIN-ARCH-013 Починить pre-existing падения миграционных тестов (test_db.py, test_kin_089_regression.py)

This commit is contained in:
Gros Frumos 2026-03-17 16:02:19 +02:00
parent 8be9a52559
commit bf635f16ff
2 changed files with 26 additions and 2 deletions

View file

@ -1139,7 +1139,7 @@ def _execute_department_head_step(
try: try:
models.create_handoff( models.create_handoff(
conn, 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, task_id=task_id,
from_department=dept_name, from_department=dept_name,
to_department=next_department, to_department=next_department,
@ -1216,6 +1216,8 @@ def run_pipeline(
allow_write: bool = False, allow_write: bool = False,
noninteractive: bool = False, noninteractive: bool = False,
initial_previous_output: str | None = None, initial_previous_output: str | None = None,
parent_pipeline_id: int | None = None,
department: str | None = None,
) -> dict: ) -> dict:
"""Execute a multi-step pipeline of agents. """Execute a multi-step pipeline of agents.
@ -1258,8 +1260,11 @@ def run_pipeline(
# Create pipeline in DB # Create pipeline in DB
pipeline = None pipeline = None
if not dry_run: if not dry_run:
effective_route_type = "dept_sub" if parent_pipeline_id else route_type
pipeline = models.create_pipeline( 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) # Save PID so watchdog can detect dead subprocesses (KIN-099)
models.update_pipeline(conn, pipeline["id"], pid=os.getpid()) models.update_pipeline(conn, pipeline["id"], pid=os.getpid())

View file

@ -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 // Audit
const auditLoading = ref(false) const auditLoading = ref(false)
const auditResult = ref<AuditResult | null>(null) const auditResult = ref<AuditResult | null>(null)
@ -389,6 +407,7 @@ async function load() {
project.value = await api.project(props.id) project.value = await api.project(props.id)
loadMode() loadMode()
loadAutocommit() loadAutocommit()
loadAutoTest()
} catch (e: any) { } catch (e: any) {
error.value = e.message error.value = e.message
} finally { } finally {