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
Functional workflows accept a response whose runtime type does not match the response_type declared in RunContext.request_info() during response-only HITL resume.
On current main, the response is accepted and the output is:
['not-an-int:str']
Expected behavior
A response that violates the declared response_type should be validated consistently with the graph workflow runtime: valid values may be coerced according to the existing workflow typing rules, while incompatible values should raise a clear type-mismatch error before the workflow produces output.
Impact
A malformed or incorrectly deserialized HITL response can silently enter a functional workflow as the wrong Python type. This makes the declared response_type ineffective and can produce incorrect downstream decisions, formatting, or persistence without an error at the response boundary.
Related context
The review discussion on the original functional workflow implementation in #4238 identified that response-only resumes accept responses without the type/request validation enforced by the existing workflow runtime. This issue tracks that unresolved follow-up. It is separate from #8299, which concerns user state being lost during the same response-only resume path, and from #8292, which concerns concurrent cached-step result ordering.
Clarification: existing functional workflow behavior and regression tests intentionally allow a None response (with a warning), even when response_type is non-optional. The proposed validation will preserve that compatibility behavior and reject only non-None values that cannot be coerced to the declared response type.
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
Repro: python/packages/core/agent_framework/_workflows/_functional.py::RunContext.request_info at lines 244-247 returns the raw value populated by _set_responses without checking the declared response type. It triggers after request_info(..., response_type=int, request_id="typed") pauses a functional workflow and run(responses={"typed": "not-an-int"}) resumes it; the minimal test expects ValueError but observes ['not-an-int:str'].
Activity
CoralGarden52 commentedon Sep 11, 2026
Clarification: existing functional workflow behavior and regression tests intentionally allow a
Noneresponse (with a warning), even whenresponse_typeis non-optional. The proposed validation will preserve that compatibility behavior and reject only non-Nonevalues that cannot be coerced to the declared response type.github-actions commentedon Sep 11, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
python/packages/core/agent_framework/_workflows/_functional.py::RunContext.request_infoat lines 244-247 returns the raw value populated by_set_responseswithout checking the declared response type. It triggers afterrequest_info(..., response_type=int, request_id="typed")pauses a functional workflow andrun(responses={"typed": "not-an-int"})resumes it; the minimal test expectsValueErrorbut observes['not-an-int:str'].python/packages/core/tests/workflow/test_functional_workflow.py1.18.0