kin: KIN-ARCH-020 Передавать blocked_reason от dept head в DB при блокировке sub-pipeline

This commit is contained in:
Gros Frumos 2026-03-17 16:04:48 +02:00
parent 90d7abfa80
commit 136916793e
2 changed files with 308 additions and 11 deletions

View file

@ -140,17 +140,10 @@ class TestBlockedReasonPropagation:
task = models.get_task(conn, "PROJ-001")
assert task["status"] == "blocked"
# BUG DOCUMENTED: The specific worker error is NOT in task.blocked_reason.
# Current behavior: task.blocked_reason == 'Department backend_head sub-pipeline failed'
# Desired behavior: specific_worker_error should appear in task.blocked_reason
assert specific_worker_error not in (task["blocked_reason"] or ""), (
f"Unexpected: specific worker error was propagated to task.blocked_reason. "
f"This means Issue 1 has been fixed — update this test!"
)
# Verify: generic message IS what gets stored (documents current behavior)
assert "backend_head" in (task["blocked_reason"] or ""), (
"Expected task.blocked_reason to contain 'backend_head' (the generic message)"
# FIXED (KIN-ARCH-014): specific worker error IS now in task.blocked_reason
assert specific_worker_error in (task["blocked_reason"] or ""), (
f"Expected specific worker error in task.blocked_reason, "
f"got: {task['blocked_reason']!r}"
)
@patch("agents.runner._run_autocommit")