Repository navigation
[BREAKING] Python: Reject unsafe functional step replay - #9391
Draft
Atharva Vichare (atty57) wants to merge 2 commits into
Draft
Atharva Vichare (atty57) wants to merge 2 commits into
Atharva Vichare (atty57) wants to merge 2 commits into
Conversation
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:48 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:49 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:49 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:49 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:50 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:50 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 16:51 — with
GitHub Actions
Active
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Nested legacy replay can still silently return the wrong cached result when arguments are fingerprintable.
1 open finding
What changed in this PR
Adds fail-loud safeguards for functional workflow replay when step arguments lack stable identities.
Changes:
- Rejects unsafe checkpoint and HITL replay for opaque arguments.
- Validates legacy cache hits and replayable results.
- Adds regression tests and updates replay documentation.
| File | Description |
|---|---|
python/packages/core/agent_framework/_workflows/_functional.py |
Adds replay-safety guards and documentation. |
python/packages/core/tests/workflow/test_functional_workflow.py |
Adds opaque-argument replay regression tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 17:17 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 17:17 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 22:02 — with
GitHub Actions
Active
Atharva Vichare (atty57)
deployed
to
github-app-auth
October 14, 2026 22:02 — with
GitHub Actions
Active
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
Bypassing a cached outer
@stepskips its inner call counters. A later nested or top-level call can then silently reuse an earlier invocation's result from an order-only cache. Legacy checkpoints remain unsafe even when current arguments are fingerprintable or callers supply explicit replay keys; opaque arguments could also produce unsafe new checkpoints.Description & Review Guide
replay_keyfor checkpoint/HITL replay. Legacy order-only checkpoints are no longer replayable, including flat sequential checkpoints, and must be regenerated in a new run. Existing versioned checkpoints continue to replay. Sequential execution without replay still supports opaque arguments. With explicit keys, nested crash recovery returns[['A', 'B']]and only rerunsb.This chooses the fail-loud fix from issue option #3 over automatically scoping counters (option #1), keeping the fix focused and requiring explicit invocation identity for opaque inputs.
Related Issue
Fixes #9385
Maintainer agreement on this direction is pending; no competing open PR was found before opening this PR.
AI Assistance
AI assistance details: Issue analysis, implementation, tests, docstrings, and this PR description.
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 title flags the intentional compatibility change for legacy order-only checkpoints. All 168 functional workflow tests pass, including the nested and mixed nested/direct legacy replay regressions. Ruff lint/format, source and test Pyright, and test mypy checks pass on the touched files. The full
poe checkis left to CI; maintainer agreement is pending.