-
Notifications
You must be signed in to change notification settings - Fork 959
Open
Labels
Description
When using a workflow with Human-in-the-Loop (HIL) via ctx.request_info() and wrapping it with .as_agent() for DevUI, the HIL response validation fails with:
Response type mismatch for request ID ...: expected <class 'ApprovalResponse'>, got <class 'dict'>
Root Cause
- Graph mode (
_execute_workflowinagent_framework_devui/_executor.py): Callsparse_input_for_type()at line 454 to convert dict → dataclass beforesend_responses_streaming() - Agent mode (
_execute_agent): Has no HIL handling - passes raw dicts directly toagent.run_stream(), which eventually hits validation at_workflow.py:703
Expected Behavior
WorkflowAgent wrapped workflows should work with HIL in DevUI the same way direct workflow execution does.
Suggested Fix
In _execute_agent(), detect when the agent is a WorkflowAgent and apply the same type conversion logic used in _execute_workflow().
Workaround
Use graph mode only (pass workflow directly to serve() without .as_agent())