Skip to content

Python: Refactor RequestInfoExecutor#1403

Merged
TaoChenOSU merged 5 commits into
microsoft:mainfrom
TaoChenOSU:taochen/python-refactor-request-info-executor
Oct 13, 2025
Merged

Python: Refactor RequestInfoExecutor#1403
TaoChenOSU merged 5 commits into
microsoft:mainfrom
TaoChenOSU:taochen/python-refactor-request-info-executor

Conversation

@TaoChenOSU

@TaoChenOSU TaoChenOSU commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

The RequestInfoExecutor has too many data structures that are dictionary based without clear definitions of the keys and values. The RequestInfoExecutor module also contains classes that can be put into their own modules.

This PR aims to refactor the RequestInfoExecutor class and the module that contains it. This will slim down the module and make the RequestInfoExecutor more maintainable such that we can further build on top of it.

Description

  1. Introduce the PendingRequestSnapshot type to replace the original dictionary-based data structure. This also removes some unused propterties.
  2. Move WorkflowCheckpointSummary and related methods to their own module _checkpoint_summary.py.

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.

@TaoChenOSU TaoChenOSU self-assigned this Oct 10, 2025
Copilot AI review requested due to automatic review settings October 10, 2025 22:36
@TaoChenOSU TaoChenOSU added python Usage: [Issues, PRs], Target: Python workflows Usage: [Issues, PRs], Target: Workflows labels Oct 10, 2025
@github-actions github-actions Bot changed the title Refactor RequestInfoExecutor Python: Refactor RequestInfoExecutor Oct 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 refactors the RequestInfoExecutor by introducing a structured PendingRequestSnapshot type to replace dictionary-based data structures and extracts checkpoint summary functionality into a separate module.

  • Introduces PendingRequestSnapshot dataclass for better type safety in request tracking
  • Moves WorkflowCheckpointSummary and related functions to a new _checkpoint_summary.py module
  • Updates workflow sample files to use the new get_checkpoint_summary function instead of static methods

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
python/packages/core/agent_framework/_workflows/_request_info_executor.py Major refactor replacing dictionary-based pending requests with typed PendingRequestSnapshot, moving checkpoint functionality
python/packages/core/agent_framework/_workflows/_checkpoint_summary.py New module containing extracted checkpoint summary functionality
python/packages/core/agent_framework/_workflows/__init__.py Exports new types and functions from the refactored modules
Sample files Updated to use new get_checkpoint_summary function
Test files Updated to use new data structures and removed outdated tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@markwallace-microsoft

markwallace-microsoft commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework/_workflows
   _checkpoint_summary.py1053467%48–53, 73, 78–83, 87, 89, 92, 100–101, 103, 105, 113–115, 131, 141–146, 181, 183, 190–191
   _request_info_executor.py29710664%142, 144, 150, 161, 165, 258, 263, 301–308, 314–321, 323–327, 329–335, 341, 363, 368, 375–379, 381–389, 391–396, 398–400, 407–410, 418, 422, 442–444, 452, 455, 459, 464–467, 470, 476–477, 492–496, 506–507, 511–512, 517–520, 523, 525–531, 535, 537, 555, 563, 569
   _runner.py2354580%126, 128–131, 171–174, 178, 211–213, 230, 236, 262–263, 284–285, 287–288, 324–326, 332–333, 341, 347, 355–357, 362–363, 398, 400–403, 414, 416–417, 420–423
   _workflow_context.py1661193%55–56, 64, 68, 82, 158, 183, 255, 351, 422, 436
TOTAL10302169683% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
1271 98 💤 0 ❌ 0 🔥 27.616s ⏱️

@TaoChenOSU TaoChenOSU requested a review from ekzhu October 13, 2025 15:08
@TaoChenOSU TaoChenOSU enabled auto-merge October 13, 2025 15:08
Comment thread python/packages/core/agent_framework/_workflows/_checkpoint_summary.py Outdated
Comment thread python/packages/core/agent_framework/_workflows/_checkpoint_summary.py Outdated
Comment thread python/samples/_run_all_samples.py
Comment thread python/samples/_run_all_samples.py
@TaoChenOSU TaoChenOSU added this pull request to the merge queue Oct 13, 2025
Merged via the queue into microsoft:main with commit fc12ab9 Oct 13, 2025
20 checks passed
ReubenBond pushed a commit to ReubenBond/agent-framework that referenced this pull request Oct 28, 2025
* Refactor RequestInfoExecutor

* Update AI script

* Fix formatting

* Address comments

* fix unit test
arisng pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* Refactor RequestInfoExecutor

* Update AI script

* Fix formatting

* Address comments

* fix unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python workflows Usage: [Issues, PRs], Target: Workflows

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants