[BREAKING] Python: Remove request_type param from ctx.request_info() - #1824
Merged
Tao Chen (TaoChenOSU) merged 2 commits intoOct 31, 2025
Conversation
Tao Chen (TaoChenOSU)
requested review from
Eric Zhu (ekzhu) and
Evan Mattson (moonbox3)
October 31, 2025 00:18
Contributor
Tao Chen (TaoChenOSU)
enabled auto-merge
October 31, 2025 00:20
Evan Mattson (moonbox3)
approved these changes
Oct 31, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the request_info API to automatically infer the request_type from the request_data parameter, removing the need for callers to explicitly pass it. The request_type is now derived using type(request_data) internally.
- Simplified the
request_info()method signature by removing the redundantrequest_typeparameter - Updated
RequestInfoEventto deriverequest_typefromrequest_dataautomatically - Added validation during deserialization to ensure type consistency between serialized
request_typeand actual data type - Updated all call sites across samples and tests to use the new simplified API
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
_workflow_context.py |
Removed request_type parameter from request_info() method signature and added internal derivation logic |
_events.py |
Modified RequestInfoEvent to automatically set request_type from data; added type mismatch validation in deserialization |
_request_info_mixin.py |
Updated documentation example to reflect new API signature |
_executor.py |
Updated example code in docstring to use response_type keyword argument |
_workflow_executor.py |
Updated example code in docstring to use response_type keyword argument |
_handoff.py |
Updated request_info() call to use simplified API |
_magentic.py |
Updated request_info() call to use simplified API |
| Sample files (7 files) | Updated all sample code to use the new simplified API with keyword arguments |
| Test files (7 files) | Updated test code to remove request_type parameter from calls and test data |
Tao Chen (TaoChenOSU)
disabled auto-merge
October 31, 2025 00:24
Tao Chen (TaoChenOSU)
enabled auto-merge
October 31, 2025 00:32
Ben Thomas (alliscode)
approved these changes
Oct 31, 2025
Aris Nguyen (arisng)
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…icrosoft#1824) * Remove request_type param from ctx.request_info() * Address comments
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
The new
request_infoAPI is clunky due to therequest_typeparameter, which requires developers to provide the type of the request payload when calling the API. This is unnecessary because we can get the type during runtime.Description
Remove the
request_typeparameter on therequest_infoAPI.Contribution Checklist