From a13ab760027a8acb6961a5c6bc7d0fe4b73fb109 Mon Sep 17 00:00:00 2001 From: arya rizky Date: Tue, 19 May 2026 13:19:35 +0700 Subject: [PATCH] fix(agenton): use AsyncGenerator return annotation for asynccontextmanager (#36361) Co-authored-by: Arya Rizky --- dify-agent/src/agenton/compositor/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dify-agent/src/agenton/compositor/core.py b/dify-agent/src/agenton/compositor/core.py index 355b143356..4e77e9c1e0 100644 --- a/dify-agent/src/agenton/compositor/core.py +++ b/dify-agent/src/agenton/compositor/core.py @@ -14,7 +14,7 @@ hydrated deterministically. """ from collections import OrderedDict -from collections.abc import AsyncIterator, Mapping, Sequence +from collections.abc import AsyncGenerator, Mapping, Sequence from contextlib import asynccontextmanager from dataclasses import dataclass from typing import Any, Generic, cast @@ -178,7 +178,7 @@ class Compositor(Generic[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, *, configs: Mapping[str, LayerConfigInput] | None = None, session_snapshot: CompositorSessionSnapshotValue | None = None, - ) -> AsyncIterator[CompositorRun[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, LayerUserPromptT]]: + ) -> AsyncGenerator[CompositorRun[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, LayerUserPromptT]]: """Create a fresh run, enter layers in graph order, and yield it. Configs are keyed by layer node name and validated before factories run.