Python: Add CreateConversationExecutor, fix input routing, remove unused handler layer#4159
Open
moonbox3 wants to merge 7 commits intomicrosoft:mainfrom
Open
Python: Add CreateConversationExecutor, fix input routing, remove unused handler layer#4159moonbox3 wants to merge 7 commits intomicrosoft:mainfrom
moonbox3 wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the Python declarative (graph-based) workflow execution path by adding missing executors (notably CreateConversation), improving input/state routing for PowerFx expressions, and removing an unused legacy “action handler” execution layer.
Changes:
- Add
CreateConversationExecutor, improve dynamic agent name expression evaluation, and adjust branch-exit/terminator handling to prevent incorrect edge wiring. - Thread runner iteration limits via
WorkflowFactory/DeclarativeWorkflowBuilder, supporting a YAMLmaxTurnsfield; update DeepResearch sample accordingly. - Remove the unused legacy handler layer and associated tests; update samples/tests to use the executor-based system.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| workflow-samples/DeepResearch.yaml | Adds maxTurns: 500 and sets autoSend: false to improve looping convergence and suppress raw JSON output. |
| python/samples/03-workflows/declarative/human_in_loop/main.py | Updates streaming output handling to align with executor-based output payloads. |
| python/samples/03-workflows/declarative/deep_research/main.py | Adjusts streaming print formatting (adds newlines between output events). |
| python/samples/02-agents/context_providers/redis/redis_conversation.py | Removes an unused import. |
| python/samples/01-get-started/06_host_your_agent.py | Adds whitespace (formatting-only). |
| python/packages/declarative/tests/test_workflow_samples_integration.py | Switches coverage check from handlers to ALL_ACTION_EXECUTORS. |
| python/packages/declarative/tests/test_workflow_handlers.py | Removes tests for the deleted handler layer. |
| python/packages/declarative/tests/test_workflow_factory.py | Removes tests tied to the deleted handler-layer ActionContext. |
| python/packages/declarative/tests/test_graph_coverage.py | Adds tests for expression-based agent name resolution, terminator branch exit handling, and CreateConversationExecutor. |
| python/packages/declarative/tests/test_external_input.py | Removes tests for the deleted handler-based HITL implementation. |
| python/packages/declarative/tests/test_additional_handlers.py | Removes tests for the deleted handler layer (conversation/variables/etc.). |
| python/packages/declarative/agent_framework_declarative/_workflows/_human_input.py | Removes the handler-based HITL implementation module. |
| python/packages/declarative/agent_framework_declarative/_workflows/_handlers.py | Removes the handler registry/types module. |
| python/packages/declarative/agent_framework_declarative/_workflows/_factory.py | Adds max_iterations plumbing into graph builder creation. |
| python/packages/declarative/agent_framework_declarative/_workflows/_executors_control_flow.py | Ensures JoinExecutor initializes state before passing through. |
| python/packages/declarative/agent_framework_declarative/_workflows/_executors_basic.py | Adds CreateConversationExecutor and registers it in BASIC_ACTION_EXECUTORS. |
| python/packages/declarative/agent_framework_declarative/_workflows/_executors_agents.py | Supports = PowerFx expressions for agent name fields across schema variants. |
| python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py | Adds more terminators, threads max_iterations into WorkflowBuilder, and improves _get_branch_exit terminator handling. |
| python/packages/declarative/agent_framework_declarative/_workflows/_declarative_base.py | Populates System.LastMessage.Text from string (and non-dict) workflow inputs. |
| python/packages/declarative/agent_framework_declarative/_workflows/_actions_error.py | Removes handler-based error actions module. |
| python/packages/declarative/agent_framework_declarative/_workflows/_actions_control_flow.py | Removes handler-based control-flow actions module. |
| python/packages/declarative/agent_framework_declarative/_workflows/_actions_basic.py | Removes handler-based basic actions module. |
| python/packages/declarative/agent_framework_declarative/_workflows/_actions_agents.py | Removes handler-based agent invocation actions module. |
| python/packages/declarative/agent_framework_declarative/_workflows/init.py | Updates exports to reflect the executor-only workflow implementation. |
python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py
Outdated
Show resolved
Hide resolved
python/packages/declarative/tests/test_workflow_samples_integration.py
Outdated
Show resolved
Hide resolved
4 tasks
|
Hi @moonbox3, could you also check System.ConversationId? |
eavanvalkenburg
approved these changes
Feb 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Supersedes #4065
This branch builds on sample-fixes-8 (#4065) and keeps all of its executor fixes. It supersedes #4065 because that PR worked around missing executors by using a simplified local workflow.yaml; this PR fixes the root causes instead.
Description
Contribution Checklist