From e7a7ad760dc5c8c8918d07c1c25c4e39f6addd5e Mon Sep 17 00:00:00 2001 From: Nanduu24 Date: Thu, 22 Oct 2026 15:36:13 -0500 Subject: [PATCH] Python: fix(core): define EdgeGroup's builtins.type alias at module scope The `from builtins import type as builtin_type` import lived inside the EdgeGroup class body, making `EdgeGroup.builtin_type` a class member aliasing builtins.type. The Public API Compatibility workflow (griffe) raises `AliasResolutionError: Could not resolve alias agent_framework._workflows._edge.EdgeGroup.builtin_type pointing at builtins.type` while loading the API, which fails the check on every PR. Move the alias to module scope (matching _request_info_mixin.py, which already does this) so the spurious class member is gone while the annotations (builtin_type[...]) stay resolvable. No runtime or type-checker behavior change: the module uses `from __future__ import annotations`, and builtin_type is referenced only in annotations. Verified griffe loads EdgeGroup cleanly; pyright and ruff pass. --- python/packages/core/agent_framework/_workflows/_edge.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/packages/core/agent_framework/_workflows/_edge.py b/python/packages/core/agent_framework/_workflows/_edge.py index 549bd9c7476..a9483f7b853 100644 --- a/python/packages/core/agent_framework/_workflows/_edge.py +++ b/python/packages/core/agent_framework/_workflows/_edge.py @@ -5,6 +5,7 @@ import inspect import logging import uuid +from builtins import type as builtin_type from collections.abc import Awaitable, Callable, Sequence from dataclasses import dataclass, field from typing import Any, ClassVar, TypeAlias, TypeVar @@ -312,8 +313,6 @@ class EdgeGroup(DictConvertible): type: str edges: list[Edge] - from builtins import type as builtin_type - _TYPE_REGISTRY: ClassVar[dict[str, builtin_type[EdgeGroup]]] = {} def __init__(