You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: @kernel_function mutates shared Annotated metadata dicts (description lost after first use) #14441
@kernel_function's _parse_parameter() calls meta.pop("description") on dict metadata inside typing.Annotated, mutating the caller's dict. Reusing one shared metadata dict across kernel functions silently strips the parameter description from every function after the first, and leaves the user's dict empty.
I reproduced this on current main. _parse_parameter() mutates caller-owned Annotated dict metadata via meta.pop("description"), so reusing the same metadata dict loses the description after the first decoration. I'm taking this issue with a focused fix that copies the metadata dict before parsing and a regression test covering reuse across two @kernel_function decorators. Targeted function tests and Ruff checks are passing; I'll open a small PR.
Activity
nslabhwan commentedon Sep 16, 2026
I reproduced this on current main.
_parse_parameter()mutates caller-ownedAnnotateddict metadata viameta.pop("description"), so reusing the same metadata dict loses the description after the first decoration. I'm taking this issue with a focused fix that copies the metadata dict before parsing and a regression test covering reuse across two@kernel_functiondecorators. Targeted function tests and Ruff checks are passing; I'll open a small PR.