Python: Durabletask: Re-merge main into feature branch#3418
Python: Durabletask: Re-merge main into feature branch#3418larohra wants to merge 208 commits intomicrosoft:feature-durabletask-pythonfrom
Conversation
…osoft#2738) * Add factory pattern to concurrent orchestration builder * Update readme * Address AI comments * Fix unit tests * Fix import * Prevent multiple calls to set participants or factories * Add comments * Mitigate warnings * Fix mypy * Address comments * Address Copilot comments * Fix tests
…I Structured Outpu… (microsoft#2750) * fix: ManagerSelectionResponse JSON Schema for OpenAI Structured Output Strict Mode * refactor: install pre-commit then commit again
* prevent nulls in AIAgent property * address feedback
Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
* Initial plan * Add Agent_OpenAI_Step05_Conversation sample for conversation state management Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Update Program.cs comment to accurately describe the sample Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> * Update the code to use the ConversationClient more in line with the samples in OpenAI * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Changing sample to use ChatClientAgent and conversationId in GetNewThread --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ft#2777) --- updated-dependencies: - dependency-name: AWSSDK.Extensions.Bedrock.MEAI dependency-version: 4.0.4.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
--- updated-dependencies: - dependency-name: Azure.Identity dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Azure.Identity dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Azure.Identity dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Azure.Identity dependency-version: 1.17.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…eta.5 (microsoft#2778) --- updated-dependencies: - dependency-name: Azure.AI.AgentServer.AgentFramework dependency-version: 1.0.0-beta.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Azure.AI.AgentServer.AgentFramework dependency-version: 1.0.0-beta.5 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: Azure.AI.AgentServer.AgentFramework dependency-version: 1.0.0-beta.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#2756) * added more complete parsing for mcp tool arguments * fixed mypy * added nonlocal model counter, and some fixes * fixes in naming logic * extracted json parsing function, added parametrized test and checked coverage
* Updated package versions * Small fix
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
…dot a… (microsoft#1507) * adds support for labels in edges, fixes rendering of labels in dot and mermaid, adds rendering of labels in edges * Update dotnet/src/Microsoft.Agents.AI.Workflows/Visualization/WorkflowVisualizer.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * escaping edge labels, adding tests for labels containing strange characters that would break the diagram and enabling the previous signature so the API has backwards compatibility. * Unify label in EdgeData * Edge API adjustments, removed useless "sanitizer" * fixed test --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jacob Alber <jaalber@microsoft.com> Co-authored-by: Chris <66376200+crickman@users.noreply.github.com>
…crosoft#2769) * Added an example of using kwargs in ai_function * Added thread object to ai_function kwargs * Updated docs * Small fix * Added thread parameter filtering
1. Update `connection` child types -- `kind: ApiKey` to `kind: key` otherwise schema will fail: https://microsoft.github.io/AgentSchema/reference/apikeyconnection/ 2. Update `outputSchema`'s `PropertySchema` to be `kind` instead of `type` otherwise schema will fail: https://microsoft.github.io/AgentSchema/reference/propertyschema/
…icrosoft#2808) * Revert concurrent * Fix comments
…2870) * Filter framework kwargs from MCP tool invocations * Fixes
…rosoft#2866) * Fix WorkflowAgent to emit yield_output as agent response * use raw_representation * Raw representation handling
…icrosoft#2713) (microsoft#2714) ## Summary Enhanced `HandoffBuilder._apply_auto_tools` to use the target agent's description when creating handoff tools, providing more informative tool descriptions for LLMs. ## Changes - Modified `_apply_auto_tools` to extract `description` from `AgentExecutor._agent` when available - Updated iteration to use `.items()` for more efficient dict traversal - Handoff tools now use agent descriptions instead of generic placeholders ## Example Before: "Handoff to the refund_agent agent." After: "You handle refund requests. Ask for order details and process refunds." ## Testing - All handoff tests pass (20/20) - No breaking changes to existing API Fixes microsoft#2713 Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
* fixes Python: Add env_file_path parameter to setup_observability() similar to AzureOpenAIChatClient Fixes microsoft#2186 * WIP on updates using configure_azure_monitor * improved setup and clarity * fixed root .env.example * revert changes * updated files * updated sample * updated zero code * test fixes and fixed links * fix devui * removed planning docs * added enable method and updated readme and samples * clarified docstring * add return annotation * updated naming * update capatilized version * updated readme and some fixes * updated decorator name inline with the rest * feedback from comments addressed
…mmediately (microsoft#2868) * Fix middleware terminate flag to exit function calling loop immediately * Eliminating duck typing * Improve function exec result handling * Fix race condition * Fix mypy issues
…rom checkpoint (microsoft#2867) * Fix context duplication in handoff workflows when restoring from checkpoint * Address Copilot PR review
* Update to latest Azure.AI.*, OpenAI, and M.E.AI* Absorb breaking changes in Responses surface area * Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs * Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs * Update dotnet/samples/AgentWebChat/AgentWebChat.AgentHost/Utilities/ChatClientExtensions.cs * Update dotnet/samples/GettingStarted/AgentWithOpenAI/Agent_OpenAI_Step04_CreateFromOpenAIResponseClient/Program.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Using patch to remove the model is necessary, updated the response client to actually use the the ForAgent --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+rogerbarreto@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v6...v7) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](actions/cache@v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v5...v6) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Initial Commit for Olama Connector * Added Olama Sample * Add Sample & Fixed Open Telemetry * Fixed Spelling from Olama to Ollama * remove"opentelemetry-semantic-conventions-ai ~=0.4.13" since its handled in a different pr * Added Tool Calling * Finalizing test cases * Adjust samples to be more reliable * Update python/packages/ollama/agent_framework_ollama/_chat_client.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/ollama/pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/ollama/tests/test_ollama_chat_client.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update python/packages/ollama/agent_framework_ollama/_chat_client.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Improved Docstrings & Sample * Update python/packages/ollama/agent_framework_ollama/_chat_client.py Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com> * Integrate PR Feedback - Divided Streaming and Non-Streaming into independent Methods - Catch Ollama Validation Error - Add OTEL Provider Name - Checked Ollama Messages - Add Usage Statistics * Revert setting, so it can be none * Validate Message formatting between AF and Ollama * Catch Ollama Error and raise a ServiceResponse Error * Fix mypy error * remove .vscode comma * Add Reasoning support & adjust to new structure * Add Ollama Multimodality and Reasoning * Add test cases for reasoning * Add Tests for Error Handling in Ollama Client * Update python/samples/getting_started/multimodal_input/ollama_chat_multimodal.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Integrated Copilot Feedback * Implement first PR Feedback * Adjust Readme files for examples * Adjust argument passing via additional chat options * Implemented PR Feedback * Removing Ollama Package from Core and moving samples * Fix Link & Adding Samples to Main Sample Readme * Fixing Links in Readme * Moved Multimodal and Chat Example * Fixed Link in ChatClient to Ollama * Fix AgentFramework Links in Ollama Project * Fix observability breaking change --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Eduard van Valkenburg <eavanvalkenburg@users.noreply.github.com>
…ft#2906) * Cosmos DB UT Fast Skip (Non-Configured Local envs) + Long running UT skip in pipeline when no CosmosDB changes happened * Force a CosmosDB source code change to trigger the pipeline * Address possible string boolean mismatch * Add debug * Enabling emulator always when running IT
…pic client issues in ag-ui (microsoft#3322) * Refactor ag-ui to simplify flow * Refactoring * Fix backend tool * Update tests * Improvements * Fix mypy * Fixes * Fix json serialize errors
…P tools (microsoft#3292) * fix(core): filter conversation_id when passing kwargs to MCP tools * Filter out options too * Fix uv.lock conflict
…icrosoft#3259) * added tests for content types+ unit test improvement * small fixes * small fix
…nses client (microsoft#3312) * prefer kwargs conversation_id over options * addressed comments
…icrosoft#3263) * azureai image gen sample fix * mypy fixes * addressed comments + mapping updates * image model fix * content type fix
…crosoft#3403) * add(azure-ai): support reasoning config for AzureAIClient * Update sample * Merge main * improvements * improve sample
…microsoft#3330) * Allow overriding the ChatMessageStore to be used per agent run. * Fix typos * Fix Add and add TryAdd, Contains and Remove
* Rename ChatMessageStore to ChatHistoryProvider * Fix merge issue * Fixed PR comments * Fix tests after property rename * Add unit tests and fix merge issues * Fix encoding
…nt-framework into reset-feature-branch
There was a problem hiding this comment.
Pull request overview
This PR resets the Python DurableTask feature branch to a last known good (LKG) build and merges it with the updated main branch. The changes span multiple areas including API refactoring, test infrastructure improvements, new samples, and bug fixes.
Changes:
- Renamed
ChatMessageStoretoChatHistoryProviderthroughout the codebase for better semantic clarity - Removed
runIdparameter from workflow resume methods to rely on checkpoint data - Added source generator infrastructure for workflow executors with new test projects
- Enhanced test coverage with new unit tests for OpenAI extensions and workflow components
- Added comprehensive console app samples demonstrating durable agent patterns
Reviewed changes
Copilot reviewed 165 out of 540 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotnet/tests/Microsoft.Agents.AI.Workflows.UnitTests/Sample/05_Simple_Workflow_Checkpointing.cs | Removed runId parameter from ResumeStreamAsync call |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Generators.UnitTests/Microsoft.Agents.AI.Workflows.Generators.UnitTests.csproj | New test project configuration for workflow source generators |
| dotnet/tests/Microsoft.Agents.AI.Workflows.Generators.UnitTests/GeneratorTestHelper.cs | New helper class for testing source generators with Roslyn compilation |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_GetNewThreadTests.cs | Updated test names and assertions from ChatMessageStore to ChatHistoryProvider |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgent_DeserializeThreadTests.cs | Updated test to reflect ChatHistoryProvider refactoring |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/ChatClient/ChatClientAgentOptionsTests.cs | Updated property references from ChatMessageStoreFactory to ChatHistoryProviderFactory |
| dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentExtensionsTests.cs | Added test for propagating AdditionalProperties to child agents |
| dotnet/tests/Microsoft.Agents.AI.Purview.UnitTests/PurviewWrapperTests.cs | Updated dependency from IChannelHandler to IBackgroundJobRunner |
| dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/AgentResponseExtensionsTests.cs | New test file for OpenAI extension methods |
| dotnet/tests/Microsoft.Agents.AI.DurableTask.IntegrationTests/TestHelper.cs | Added unique TaskHub names to prevent test interference |
| dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/InMemoryAgentThreadTests.cs | Refactored tests to use ChatHistoryProvider instead of ChatMessageStore |
| dotnet/tests/Microsoft.Agents.AI.Abstractions.UnitTests/ChatHistoryProviderTests.cs | Renamed and updated test class to reflect provider terminology |
| dotnet/src/Microsoft.Agents.AI/ChatClient/ChatClientAgentOptions.cs | Renamed ChatMessageStoreFactory to ChatHistoryProviderFactory |
| dotnet/src/Microsoft.Agents.AI/AgentExtensions.cs | Added code to propagate AdditionalProperties from parent to child agents |
| dotnet/src/Microsoft.Agents.AI.Workflows/WorkflowThread.cs | Added includeWorkflowOutputsInResponse parameter and updated ChatHistoryProvider usage |
| dotnet/src/Microsoft.Agents.AI.Workflows/InProcessExecution.cs | Removed runId parameter from resume methods |
| dotnet/src/Microsoft.Agents.AI.Workflows.Generators/Microsoft.Agents.AI.Workflows.Generators.csproj | New source generator project configuration |
| dotnet/src/Microsoft.Agents.AI.Purview/PurviewWrapper.cs | Updated constructor to use IBackgroundJobRunner instead of IChannelHandler |
| dotnet/src/Microsoft.Agents.AI.OpenAI/Microsoft.Agents.AI.OpenAI.csproj | Added InternalsVisibleTo for unit tests |
| dotnet/src/Microsoft.Agents.AI.DurableTask/AgentSessionId.cs | Changed ToEntityName method from public to internal |
| dotnet/src/Microsoft.Agents.AI.CosmosNoSql/CosmosDBWorkflowExtensions.cs | Added TokenCredential parameter to methods using managed identity |
| dotnet/src/Microsoft.Agents.AI.Abstractions/InMemoryAgentThread.cs | Updated to use ChatHistoryProvider terminology |
| dotnet/samples/GettingStarted/Workflows/_Foundational/07_MixedWorkflowAgentsAndExecutors/Program.cs | Fixed executor to handle List instead of single ChatMessage |
| dotnet/samples/GettingStarted/FoundryAgents/FoundryAgents_Step02_MultiturnConversation/Program.cs | Added conversation tracking for Foundry UI visibility |
| dotnet/samples/DurableAgents/ConsoleApps/README.md | New comprehensive documentation for console app samples |
| dotnet/samples/DurableAgents/ConsoleApps/01_SingleAgent/Program.cs | New sample demonstrating single agent hosting in console app |
| dotnet/nuget/nuget-package.props | Updated package version to 1.0.0-preview.260121.1 |
| dotnet/Directory.Packages.props | Updated Microsoft.Extensions.AI packages to version 10.2.0 |
| .github/workflows/python-test-coverage-report.yml | Improved PR number validation and error handling |
| .github/workflows/dotnet-build-and-test.yml | Updated setup-dotnet action to v5.1.0 |
| { | ||
| // Configure whether to show agent thinking in real-time | ||
| const bool ShowAgentThinking = false; | ||
| const bool ShowAgentThinking = true; |
There was a problem hiding this comment.
The ShowAgentThinking constant is set to true, which may produce verbose output. Consider setting this to false by default or making it configurable via command-line arguments for better sample usability.
| const bool ShowAgentThinking = true; | |
| const bool ShowAgentThinking = false; |
| from agent_framework_azurefunctions import ( | ||
| AgentCallbackContext, | ||
| AgentFunctionApp, | ||
| AgentResponseCallbackProtocol, | ||
| DurableAIAgent, |
There was a problem hiding this comment.
These imports are being removed from the stub file, but the corresponding import mappings in the init.py file are redirecting them to 'agent-framework-azurefunctions', which does not export these classes. The classes 'DurableAIAgentClient', 'DurableAIAgentOrchestrationContext', and 'DurableAIAgentWorker' are all defined in 'agent-framework-durabletask' and are not re-exported by azurefunctions. This will break type checking and imports.
| "DurableAIAgentClient", | ||
| "DurableAIAgentOrchestrationContext", | ||
| "DurableAIAgentWorker", | ||
| "get_entra_auth_token", |
There was a problem hiding this comment.
These exports are being removed but they should remain, as they are still imported from 'agent-framework-durabletask'. The type stub file should match the runtime behavior. Since the runtime init.py still has mappings for these (though incorrectly pointing to azurefunctions), removing them from all creates an inconsistency between the stub and the runtime.
| "get_entra_auth_token", |
| "agent-framework-copilotstudio", | ||
| "agent-framework-declarative", | ||
| "agent-framework-devui", | ||
| "agent-framework-durabletask", | ||
| "agent-framework-lab", |
There was a problem hiding this comment.
Removing 'agent-framework-durabletask' from the 'all' extra is inconsistent with the fact that durabletask is still a separate package with its own functionality. The code in agent_framework/azure/init.py still references durabletask classes (though incorrectly remapped to azurefunctions). If durabletask is being deprecated or merged, this should be done consistently across all files, or the package should remain in the 'all' extra.
|
|
||
| _IMPORTS: dict[str, tuple[str, str]] = { | ||
| "AgentCallbackContext": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "AgentCallbackContext": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), |
There was a problem hiding this comment.
This import mapping is incorrect. The package 'agent-framework-azurefunctions' does not export 'AgentCallbackContext'. This class is defined in 'agent-framework-durabletask' (in agent_framework_durabletask/_callbacks.py), and azurefunctions imports it from there but does not re-export it. This change will break imports like 'from agent_framework.azure import AgentCallbackContext'.
| "AgentCallbackContext": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), | |
| "AgentCallbackContext": ("agent_framework_durabletask._callbacks", "agent-framework-durabletask"), |
| "AgentCallbackContext": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), | ||
| "AgentFunctionApp": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), | ||
| "AgentResponseCallbackProtocol": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "AgentResponseCallbackProtocol": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), |
There was a problem hiding this comment.
This import mapping is incorrect. The package 'agent-framework-azurefunctions' does not export 'AgentResponseCallbackProtocol'. This protocol is defined in 'agent-framework-durabletask' (in agent_framework_durabletask/_callbacks.py), and azurefunctions imports it from there but does not re-export it. This change will break imports like 'from agent_framework.azure import AgentResponseCallbackProtocol'.
| "AgentResponseCallbackProtocol": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), | |
| "AgentResponseCallbackProtocol": ("agent_framework_durabletask._callbacks", "agent-framework-durabletask"), |
| "DurableAIAgentClient": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "DurableAIAgentOrchestrationContext": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "DurableAIAgentWorker": ("agent_framework_durabletask", "agent-framework-durabletask"), | ||
| "DurableAIAgent": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), |
There was a problem hiding this comment.
This import mapping is incorrect. The package 'agent-framework-azurefunctions' does not export 'DurableAIAgent'. This class is defined in 'agent-framework-durabletask' (in agent_framework_durabletask/_shim.py), and azurefunctions imports it from there but does not re-export it. This change will break imports like 'from agent_framework.azure import DurableAIAgent'.
| "DurableAIAgent": ("agent_framework_azurefunctions", "agent-framework-azurefunctions"), | |
| "DurableAIAgent": ("agent_framework_durabletask", "agent-framework-durabletask"), |
Motivation and Context
I've also verified by comparing the
reset-feature-branchwithmainand can confirm only the changed files fordurabletaskshow upDescription
Contribution Checklist