Skip to content

Python: Normalize durable workflow inputs#7205

Merged
moonbox3 merged 1 commit into
microsoft:mainfrom
moonbox3:durable-workflow-input
Jul 20, 2026
Merged

Python: Normalize durable workflow inputs#7205
moonbox3 merged 1 commit into
microsoft:mainfrom
moonbox3:durable-workflow-input

Conversation

@moonbox3

Copy link
Copy Markdown
Contributor

Motivation & Context

Keep reserved workflow input handling consistent across durable hosts.

Description & Review Guide

  • What are the major changes? Normalize reserved input markers at durable workflow boundaries and cover the behavior end to end.
  • What is the impact of these changes? Ordinary JSON and trusted child-workflow inputs retain their existing behavior.
  • What do you want reviewers to focus on? Boundary handling and compatibility coverage.

Related Issue

N/A

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.

Copilot AI review requested due to automatic review settings July 20, 2026 06:56
@giles17 giles17 added the python Usage: [Issues, PRs], Target: Python label Jul 20, 2026
@moonbox3
moonbox3 marked this pull request as ready for review July 20, 2026 06:57
@moonbox3
moonbox3 requested a review from a team as a code owner July 20, 2026 06:57

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 normalizes handling of framework-reserved durable-workflow input markers (e.g., __pickled__, __type__) at durable host boundaries so untrusted “marker-shaped” inputs are consistently neutralized before reaching workflow executors, aligning behavior across Durable Task and Azure Functions hosts.

Changes:

  • Durable Task orchestrator now strips pickle/type markers from initial input even when the start executor’s input type can’t be selected (e.g., union/unannotated cases).
  • Azure Functions workflow /run route now strips pickle/type markers in addition to sub-workflow envelope markers before scheduling the orchestration.
  • Adds end-to-end behavioral tests for both hosts validating neutralization of reserved marker-shaped initial input while preserving ordinary JSON behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
python/packages/durabletask/tests/test_durabletask_workflow_initial_input.py New behavioral tests validating marker-shaped initial inputs are neutralized and regular union-shaped inputs are preserved.
python/packages/durabletask/agent_framework_durabletask/_workflows/orchestrator.py Ensures initial input is sanitized via strip_pickle_markers() even when no primary input type is selected.
python/packages/azurefunctions/tests/test_azurefunctions_workflow_initial_input.py New behavioral test validating the Azure Functions /run route neutralizes reserved marker-shaped input.
python/packages/azurefunctions/agent_framework_azurefunctions/_app.py Sanitizes untrusted HTTP client input with strip_pickle_markers() before start_new().

@github-actions

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/azurefunctions/agent_framework_azurefunctions
   _app.py58513077%82–83, 86–89, 317, 375, 435–437, 439, 459, 463, 466, 468, 470, 494, 497–500, 534–536, 538, 544–545, 552, 554, 569–574, 587, 589, 604–605, 607–608, 613–615, 617–620, 624, 629–632, 636, 642, 695, 732, 738, 741, 744, 889–890, 998, 1006–1007, 1027–1029, 1035–1037, 1043–1045, 1078–1079, 1139–1140, 1189–1190, 1195, 1277, 1280, 1289–1291, 1293–1295, 1297, 1299, 1310–1313, 1315, 1317–1318, 1320, 1327–1328, 1330–1331, 1333–1334, 1336, 1340, 1350–1352, 1354–1355, 1357–1359, 1366, 1368–1369, 1371, 1392, 1397, 1409, 1481, 1571, 1586–1589, 1614
packages/durabletask/agent_framework_durabletask/_workflows
   orchestrator.py45715765%209–211, 263–265, 341–342, 344–351, 353, 360, 378–386, 492, 495–497, 500–502, 505, 507–512, 514–517, 519, 521–525, 538, 540–541, 543–548, 550–551, 553–554, 556–557, 559, 573–576, 583, 596, 603–605, 607–608, 610, 628–629, 745, 787, 793, 818, 822, 828–835, 837–838, 897, 944–945, 947–950, 959, 1059–1061, 1068–1074, 1084, 1090, 1092, 1099, 1122, 1124, 1137, 1144–1145, 1147–1148, 1152–1153, 1161–1164, 1166–1168, 1191, 1193, 1207, 1213–1214, 1216–1217, 1224–1229, 1235–1237, 1242, 1244–1245, 1250, 1252, 1259, 1264
TOTAL44684510288% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
9083 33 💤 0 ❌ 0 🔥 2m 22s ⏱️

@github-actions github-actions Bot 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.

Automated Code Review

Reviewers: 5 | Confidence: 91% | Result: All clear

Reviewed: Correctness, Security Reliability, Test Coverage, Failure Modes, Design Approach


Automated review by moonbox3's agents

@moonbox3
moonbox3 enabled auto-merge July 20, 2026 07:15
@moonbox3
moonbox3 added this pull request to the merge queue Jul 20, 2026
Merged via the queue into microsoft:main with commit c66bb39 Jul 20, 2026
43 of 44 checks passed
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants