Repository navigation
Python: Fix request-info deserialization for NoneType - #9998
Open
Giraffe0129 wants to merge 7 commits into
Open
Giraffe0129 wants to merge 7 commits into
Giraffe0129 wants to merge 7 commits into
Conversation
Giraffe0129
temporarily deployed
to
github-app-auth
November 3, 2026 00:25 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the change enabling NoneType workflow-event deserialization.
No open issues 🎉
What changed in this PR
Fixes #9938 by allowing Python workflow request-info events containing NoneType to deserialize without changing their serialized format.
Changes:
- Resolves
"builtins.NoneType"through a fixed alias after caller-supplied type validation, without importing modules. - Adds regression coverage for type serialization, event reconstruction, and workflow-agent argument round trips.
- Documents the alias and enables postponed annotations in the typing utility module.
| File | Description |
|---|---|
python/packages/core/tests/workflow/test_workflow_agent.py |
Tests argument reconstruction with None request data and a NoneType response. |
python/packages/core/tests/workflow/test_typing_utils.py |
Adds NoneType serialization and deserialization coverage. |
python/packages/core/tests/workflow/test_request_info_event_rehydrate.py |
Tests event round trips for NoneType requests and responses, plus an ordinary-type control. |
python/packages/core/agent_framework/_workflows/_typing_utils.py |
Adds and documents the fixed NoneType alias while preserving caller validation precedence. |
Review effort: Balanced
Author
|
@microsoft-github-policy-service agree |
Giraffe0129
temporarily deployed
to
github-app-auth
November 3, 2026 00:38 — with
GitHub Actions
Inactive
Giraffe0129
temporarily deployed
to
github-app-auth
November 3, 2026 07:49 — with
GitHub Actions
Inactive
This branch was successfully deployed
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 & Context
WorkflowEvent.from_dict(event.to_dict())raisesAttributeErrorwhen request data isNoneor the response type istype(None).serialize_type()produces"builtins.NoneType", but thebuiltinsmodule does not expose aNoneTypeattribute.This also prevents
WorkflowAgent.RequestInfoFunctionArgs.from_dict()from reconstructing function arguments containing these request-info events.Description & Review Guide
"builtins.NoneType"totype(None)indeserialize_type(), after caller-suppliedallowed_typesvalidation and before module-namespace lookup.from __future__ import annotationsto the modified source module to follow the Python coding standards.NoneTypecases.Related Issue
Fixes #9938
AI Assistance
AI assistance details: an AI coding assistant helped draft the implementation, regression tests, and this description, and assisted with code review and local validation. Validation included the issue reproduction, the workflow test suite, Ruff checks and formatting for the four changed files, and Pyright for the changed source file. In a separate process, disabling the mapping reproduced the original failure in five regression cases while the ordinary-type control passed.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.The workflow unit tests passed locally: 1528 passed, 1 skipped, and 2 xfailed, with 4 warnings. Ruff checks and formatting passed for all four changed files, and Pyright reported no errors or warnings for the changed source file. A full build and the complete core unit test suite have not been verified in this review, so those checklist items remain unchecked.