Files
agent-framework/python/packages
T
Evan Mattson 2e9319359b Python: Add regression tests for Entry JoinExecutor Workflow.Inputs initialization (#4335)
* Python: Add regression tests for #3948 - Entry JoinExecutor initializes Workflow.Inputs

Add tests verifying that when workflow.run() is called with a dict or string
input, the Entry node (JoinExecutor with kind: 'Entry') correctly initializes
Workflow.Inputs via _ensure_state_initialized so that:
- Expressions like =inputs.age resolve to the correct value
- Conditions like =Local.age < 13 evaluate based on actual input (not blank/0)
- String inputs populate both inputs.input and System.LastMessage.Text

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply pre-commit auto-fixes

* Fix D420 and RUF070 lint errors across packages

* Revert _workflow.py yield-inside-context-manager changes

Moving yield inside `with _framework_event_origin()` blocks in the
async generator causes ContextVar token reset failures on Python 3.12
Windows. The token stays un-reset while the generator is suspended,
and async generator finalization in a different contextvars.Context
triggers ValueError, corrupting OpenTelemetry span state and causing
test_span_creation_and_attributes to see leaked spans.

Keep yields outside the context manager blocks to ensure tokens are
reset immediately before the generator suspends.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2e9319359b ยท 2026-03-03 10:08:40 +00:00
History
..