-
Notifications
You must be signed in to change notification settings - Fork 892
Python: Add initial scaffold for durabletask package
#2761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-durabletask-python
Are you sure you want to change the base?
Python: Add initial scaffold for durabletask package
#2761
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
|||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR creates a new agent-framework-durabletask package to provide a shared foundation for Durable Task-based agent implementations. The package extracts common functionality from agent-framework-azurefunctions to establish a single source of truth for models, state management, and callbacks that can be reused across different Durable Task implementations.
Key Changes:
- New standalone package with common Durable Task integration models and state management
- Refactored
azurefunctionspackage to depend on and reusedurabletaskpackage components - Added comprehensive test coverage for the new package
Reviewed changes
Copilot reviewed 20 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| python/pyproject.toml | Added durabletask package to workspace dependencies |
| python/packages/durabletask/pyproject.toml | Package configuration for new durabletask package with dependencies on durabletask SDK |
| python/packages/durabletask/README.md | Documentation for the new package with basic usage examples |
| python/packages/durabletask/LICENSE | MIT license file for the package |
| python/packages/durabletask/DESIGN.md | Detailed design document for the durabletask provider architecture |
| python/packages/durabletask/agent_framework_durabletask/init.py | Public API exports for the package |
| python/packages/durabletask/agent_framework_durabletask/_constants.py | Constants for state serialization and runtime configuration |
| python/packages/durabletask/agent_framework_durabletask/_callbacks.py | Callback protocol definitions for agent execution |
| python/packages/durabletask/agent_framework_durabletask/_models.py | RunRequest model with serialization support for durable function boundaries |
| python/packages/durabletask/agent_framework_durabletask/_durable_agent_state.py | State schema management ported from azurefunctions with updated logger name |
| python/packages/durabletask/tests/test_models.py | Unit tests for RunRequest model including serialization |
| python/packages/durabletask/tests/test_durable_agent_state.py | Unit tests for durable agent state classes |
| python/packages/azurefunctions/pyproject.toml | Added dependency on agent-framework-durabletask |
| python/packages/azurefunctions/agent_framework_azurefunctions/_models.py | Removed RunRequest and related serialization code, now imported from durabletask |
| python/packages/azurefunctions/agent_framework_azurefunctions/_entities.py | Updated imports to use durabletask package for common models |
| python/packages/azurefunctions/agent_framework_azurefunctions/_orchestration.py | Updated imports for RunRequest from durabletask |
| python/packages/azurefunctions/agent_framework_azurefunctions/_app.py | Updated imports and added datetime for created_at field |
| python/packages/azurefunctions/agent_framework_azurefunctions/init.py | Updated callback imports to use durabletask package |
| python/packages/azurefunctions/tests/test_models.py | Updated imports to use RunRequest from durabletask |
| python/packages/azurefunctions/tests/test_entities.py | Updated imports to use common models from durabletask |
| python/packages/azurefunctions/tests/test_app.py | Updated imports to use constants and state from durabletask |
| python/packages/azurefunctions/tests/integration_tests/test_01_single_agent.py | Updated constant import from durabletask |
Comments suppressed due to low confidence (1)
python/packages/durabletask/agent_framework_durabletask/_durable_agent_state.py:88
- The logger name should be updated to reflect the durabletask package namespace. While this change was made (from "agent_framework.azurefunctions.durable_agent_state" to "agent_framework.durabletask.durable_agent_state"), the log level was changed from "warning" to "error" and stack_info was added. This is a behavioral change that should be justified. If this is intentional to better diagnose issues during the port, it should be noted. However, if the original behavior should be preserved for backward compatibility, this should remain as a warning.
python/packages/azurefunctions/agent_framework_azurefunctions/_app.py
Outdated
Show resolved
Hide resolved
python/packages/durabletask/agent_framework_durabletask/_models.py
Outdated
Show resolved
Hide resolved
python/packages/azurefunctions/agent_framework_azurefunctions/_entities.py
Show resolved
Hide resolved
python/packages/azurefunctions/agent_framework_azurefunctions/_app.py
Outdated
Show resolved
Hide resolved
python/packages/durabletask/agent_framework_durabletask/_models.py
Outdated
Show resolved
Hide resolved
python/packages/azurefunctions/agent_framework_azurefunctions/_entities.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 20 out of 25 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
python/packages/durabletask/agent_framework_durabletask/_durable_agent_state.py:88
- The log level should be warning, not error, since defaulting to the current UTC time is a fallback behavior and not a critical error. This change from warning to error with stack trace adds unnecessary noise to logs for a recoverable situation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 20 out of 25 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
python/packages/durabletask/agent_framework_durabletask/_durable_agent_state.py:88
- The error logging includes stack trace information which may be excessive for a parsing issue. Consider using logger.warning instead of logger.error with stack_info=True, as this is a data validation issue rather than an unexpected error condition. The stack trace adds noise to logs without providing actionable debugging information for malformed timestamps.
Motivation and Context
This PR adds the scaffold for a new package
agent-framework-durabletaskfor Python (.NET already has something similar).This package will enable customers of Durable Functions to create agents outside of AzureFunctions.
Description
durabletaskpackage.DESIGN.mdfor this package (will be removed once changes are ported).azurefunctionstodurabletaskto have a single source of truth.Contribution Checklist