Repository navigation
Python: fix(core): move EdgeGroup's builtins.type alias to module scope (fixes Public API Compatibility) - #9614
Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit intoOct 23, 2026
Conversation
…cope 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.
Nantha kumar (Nanduu24)
requested review from
SergeyMenshykh,
Tao Chen (TaoChenOSU),
Eduard van Valkenburg (eavanvalkenburg),
Giles Odigwe (giles17),
Jose Alvarez (jpalvarezl),
Evan Mattson (moonbox3),
Roger Barreto (rogerbarreto),
sophia-ramsey and
westey (westey-m)
as code owners
October 22, 2026 20:36
Nantha kumar (Nanduu24)
deployed
to
github-app-auth
October 22, 2026 20:36 — with
GitHub Actions
Active
Nantha kumar (Nanduu24)
deployed
to
github-app-auth
October 22, 2026 20:36 — with
GitHub Actions
Active
2 of 7 tasks
Roger Barreto (rogerbarreto)
approved these changes
Oct 22, 2026
Contributor
Author
|
Note for whoever merges: the failing |
Eduard van Valkenburg (eavanvalkenburg)
approved these changes
Oct 23, 2026
Eduard van Valkenburg (eavanvalkenburg)
enabled auto-merge
October 23, 2026 10:13
Yousuf alkhanjari (ghox789)
added a commit
to ghox789/agent-framework
that referenced
this pull request
Oct 23, 2026
Bring the PR branch up to date with upstream main so CI re-runs against current base (clears the Public API Compatibility failure fixed upstream in microsoft#9614 and the merge-gatekeeper BEHIND state). No changes to the fix itself. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BhP294P7bydCU9UZxwrohh
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Public API Compatibilitycheck currently fails on PRs with:The cause is that
from builtins import type as builtin_typeis written inside theEdgeGroupclass body, sobuiltin_typebecomes a class member (EdgeGroup.builtin_type) aliasingbuiltins.type. griffe treats it as a public alias and errors trying to resolve it while building the API, which fails the workflow.Fix
Move the alias to module scope, matching
_workflows/_request_info_mixin.py, which already importsbuiltin_typeat module level. The annotations that use it (_TYPE_REGISTRY: ClassVar[dict[str, builtin_type[EdgeGroup]]]andEdgeGroup.register) are unchanged and still resolve, whileEdgeGroupno longer exposes a spuriousbuiltin_typemember.This is behavior-preserving: the module uses
from __future__ import annotations, andbuiltin_typeis referenced only in annotations — nothing accessesEdgeGroup.builtin_type/self.builtin_typeat runtime. (The other occurrences in_executor.pyare method-local, so they are not class members and are unaffected.)Verification
griffenow loadsEdgeGroupcleanly — noAliasResolutionError, and nobuiltin_typemember.pyright(strict) andruffpass on the file.