Python: Fixed declarative deep research sample#4065
Open
dmytrostruk wants to merge 4 commits intomicrosoft:mainfrom
Open
Python: Fixed declarative deep research sample#4065dmytrostruk wants to merge 4 commits intomicrosoft:mainfrom
dmytrostruk wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes and completes the Python declarative “Deep Research” workflow sample and corrects several declarative workflow runtime behaviors to support dynamic agent dispatch and correct control-flow graph wiring.
Changes:
- Adds a missing
workflow.yamlimplementing the Magentic orchestration pattern with dynamic agent selection. - Fixes declarative runtime behavior for (a) expression-based agent name resolution, (b) initializing workflow state when
JoinExecutoris the entry node, and (c) preventing successor wiring for terminator branch exits. - Adds unit tests covering expression-based agent name resolution and terminator branch exit handling.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/03-workflows/declarative/deep_research/workflow.yaml | Introduces the declarative Deep Research workflow definition with manager-driven dynamic agent dispatch. |
| python/samples/03-workflows/declarative/deep_research/main.py | Simplifies workflow YAML path resolution to always use the local workflow.yaml. |
| python/packages/declarative/tests/test_graph_coverage.py | Adds tests for dynamic agent-name expression evaluation and terminator branch exit handling. |
| python/packages/declarative/agent_framework_declarative/_workflows/_executors_control_flow.py | Ensures workflow state initialization when JoinExecutor is used as the entry node. |
| python/packages/declarative/agent_framework_declarative/_workflows/_executors_agents.py | Enables expression evaluation for agent names in InvokeAzureAgentExecutor._get_agent_name(). |
| python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py | Skips terminator actions as branch exits to avoid incorrect dual-edge wiring. |
python/packages/declarative/agent_framework_declarative/_workflows/_declarative_builder.py
Show resolved
Hide resolved
TaoChenOSU
reviewed
Feb 19, 2026
| if not workflow_path.exists(): | ||
| # Fall back to local copy if workflow-samples doesn't exist | ||
| workflow_path = Path(__file__).parent / "workflow.yaml" | ||
| workflow_path = Path(__file__).parent / "workflow.yaml" |
Contributor
There was a problem hiding this comment.
I think the yaml workflow is supposed to be shared between Python and .Net. But let's wait for @moonbox3 's confirmation.
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
declarative/marketingsample.Contribution Checklist