Skip to content

Conversation

@larohra
Copy link
Contributor

@larohra larohra commented Dec 10, 2025

Motivation and Context

This PR adds the scaffold for a new package agent-framework-durabletask for Python (.NET already has something similar).
This package will enable customers of Durable Functions to create agents outside of AzureFunctions.

Description

  • Create scaffolding for durabletask package.
  • Add a proposed DESIGN.md for this package (will be removed once changes are ported).
  • Port over common modules from azurefunctions to durabletask to have a single source of truth.
  • Port over relevant tests too.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

@markwallace-microsoft markwallace-microsoft added documentation Improvements or additions to documentation python labels Dec 10, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Dec 10, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _app.py3738078%199–200, 205–206, 424, 432–433, 453–455, 461–463, 469–471, 503–504, 564–565, 700, 703, 712–714, 716–718, 720, 722, 733, 735–738, 740, 742–743, 745, 752–753, 755–756, 758–759, 761, 765, 775–777, 779–780, 782–784, 791, 793–794, 796, 817, 822, 834, 911, 923, 930–932, 977, 991, 1002–1004, 1006–1009, 1034, 1041, 1043, 1046
   _entities.py1772188%120, 160–161, 212, 220, 225–226, 253–254, 263, 270, 281, 287–288, 307–308, 378, 410–412, 414
   _models.py69395%192, 195, 198
   _orchestration.py1131289%110–111, 115, 355, 360–367
TOTAL15875243284% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
2387 130 💤 0 ❌ 0 🔥 55.225s ⏱️

@larohra larohra changed the base branch from main to feature-durabletask-python December 10, 2025 21:48
Copilot AI review requested due to automatic review settings December 10, 2025 22:29
Copy link
Contributor

Copilot AI left a 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 azurefunctions package to depend on and reuse durabletask package 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.

Copilot AI review requested due to automatic review settings December 10, 2025 23:53
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 11, 2025 19:49
Copy link
Contributor

Copilot AI left a 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.

@larohra larohra marked this pull request as ready for review December 11, 2025 19:55
@larohra larohra requested a review from a team as a code owner December 11, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants