even MORE code review

stateful to not deadhang, graph context -> output, more explicit state errors, other misc changes idfk any of those good thing theyre fixed tho
This commit is contained in:
lda
2026-05-26 02:33:41 +07:00 Verified
parent 9d11f78111
commit 95ec73d518
12 changed files with 159 additions and 14 deletions
+6
View File
@@ -216,7 +216,13 @@ def _lineage_chain(
) -> Iterator[LineageState]:
lineage = _lineage(run, scope_id=scope_id, lineage_id=lineage_id)
reverse_chain: list[LineageState] = []
seen: set[str] = set()
while True:
if lineage.id in seen:
raise WorkflowExecutionError(
f"cycle detected in lineage chain at {lineage.id!r}"
)
seen.add(lineage.id)
reverse_chain.append(lineage)
if lineage.parent_id is None:
break