Repository navigation
Python: fix(devui): discover entities exported with an annotated assignment - #9128
Conversation
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: Findings reported
Scope: full PR (1 commit(s)): f1fc502470be
Model: gpt-5.6-sol
Overview
The change correctly distinguishes initialized annotated exports from declaration-only annotations, preserves lazy discovery, and adds focused positive and negative coverage. However, the existing whole-tree traversal causes the new AnnAssign branch to treat function- or class-local annotations as module exports, creating invalid entities that fail when loaded.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/devui/agent_framework_devui/_discovery.py
|
/review |
There was a problem hiding this comment.
MAF Automated Review — Iteration 2
Result: Findings reported
Scope: 1 net-new commit(s): da92d0e51f9b
Model: gpt-5.6-sol
Overview
The change replaces the broad AST walk with explicit traversal that skips function and class bodies, resolving the reported nested-scope false positives while retaining module-level conditional exports. The focused test covers initialized and bare annotations, module-level control flow, and nested function/class names, while lazy loading still validates the resulting module attribute and entity protocol. However, the blanket scope skip also removes runtime-valid module exports created by called factories that explicitly assign a global, causing a compatibility regression for previously discoverable files.
Reviewed the supplied incremental change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.
Affected areas: python/packages/devui/agent_framework_devui/_discovery.py
Document the annotated-assignment entity discovery fix merged in microsoft#9128 and bring the release scope to 77 merged Python pull requests.
* Bump Python package versions for 1.22.0 release Update all published Python packages because Python 3.15 metadata changed across the workspace. Apply minor bumps to stable packages with breaking or additive API work, patch Orchestrations, stamp alpha and beta packages with 261015, refresh the core[all] release cohort, raise Core floors only for packages that require the coordinated content-identity contract, and update release notes and lockfiles. * Address Python 1.22 release review feedback Align all Hosting adapters on the co-released Hosting version, remove the intentionally unpublished Lab package from the release cohort, document the mixed-version persisted-state constraint, and add the merged Message string fix to the changelog. * Add merged DevUI fix to Python 1.22 notes Document the annotated-assignment entity discovery fix merged in microsoft#9128 and bring the release scope to 77 merged Python pull requests. * Clarify Python 1.22 persisted-state warning Move the mixed-version warning to the top of the release notes and distinguish affected serialized histories, snapshots, sessions, and checkpoint state from unaffected plain metadata. * Relax DevUI orchestration dev extra Allow DevUI development installs to resolve any compatible 1.x Orchestrations release, avoiding the stale RC1 exact pin and remaining compatible with the 1.22 release cohort.
Motivation & Context
DevUI directory discovery only checked
ast.Assignnodes for a module-levelagent/workflow, so a file that declares it with a type annotation (agent: Agent = Agent(...), anast.AnnAssign) was never listed.Description & Review Guide
_has_entity_exportsalso accepts an annotated assignment that has a value. A bare declaration (agent: Agent) is still ignored.Tests:
test_discover_file_entity_with_annotated_exportintests/devui/test_discovery.py(an annotated export is discovered, a bare declaration is not); it fails onmain.test_discovery.pypasses, ruff check and format clean.Related Issue
Fixes #9127
AI Assistance
AI assistance details: issue analysis, implementation, tests and this description.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.🤖 Generated with Claude Code