Skip to content

fix(testing): match ReplayChildren lifecycle and wire form of the local service - #1001

Open
MaxonT wants to merge 1 commit into
aws:mainfrom
MaxonT:contrib/859-auto
Open

MaxonT wants to merge 1 commit into
aws:mainfrom
MaxonT:contrib/859-auto

Conversation

@MaxonT

@MaxonT MaxonT commented Nov 28, 2026 •

Copy link
Copy Markdown

Hello, I picked this issue up and here is what I came up with.

Fixes #859.

Description of changes

In the testing package, ReplayChildren is now recorded and projected the way the issue describes:

  • OperationProcessor._create_context_details records true only when a SUCCEED or FAIL update explicitly asks for it. Any other closing case records false, and START never retains it.
  • A new project_operation_dict in model.py applies the testing-service projection to an already serialized operation: a STARTED context carries no ReplayChildren, a completed context carries an explicit boolean. The Operation it is given is not changed.
  • The projection is applied on the three paths the issue lists: the Lambda invocation JSON (invoker.py, _invocation_input_payload), GetDurableExecutionStateResponse.to_dict and CheckpointUpdatedExecutionState.to_dict. Core Operation conversion and its generic serialization are untouched.

Design

Design note (rule 3): not needed, the issue is the design and this is a local-service projection, not a new option or public API.

Simpler options considered (rule 2): one helper applied at the three serialization points, instead of changing core serialization (which the issue rules out) or adding a flag.

Root cause (rule 5): the processor copied context_options.replay_children on every action, including START, and core serialization drops a false value, so a completed context could not state an explicit false.

Net change: about 45 source lines in three files, no public API members added (project_operation_dict and _invocation_input_payload are internal helpers).

Assumptions

The wire behaviour (field omitted while STARTED, explicit boolean when completed) is taken from the issue text and PR #795 and has not been checked against deployed AWS Lambda. That part is unverified.

Decisions not covered by the issue or the design note

  • A context whose status is neither STARTED nor completed gets the explicit boolean, since the issue only names STARTED and completed.
  • The invocation projection pairs operations by position and requires equal lengths (zip(..., strict=True)), so a mismatch fails loudly instead of skipping a projection.

Verification

  • New tests/replay_children_wire_test.py (13 tests): the closing matrix for SUCCEED and FAIL with options omitted, empty, false and true; START not retaining true; STARTED omission and completed boolean on the state response, checkpoint response and invocation payload; non-context operations unchanged.
  • With the processor change reverted, test_start_does_not_retain_replay_children fails; with it restored, all 13 pass.
  • Full aws-durable-execution-sdk-python-testing suite: 1899 passed.
  • No existing test expectation was edited.
  • ruff format --check is clean for the changed files. ruff check reports one existing InvocationStatus redefinition in runner.py, which this change does not touch.

Not run

hatch environments, type checking, the core and examples packages, a public child-context workflow test, memory and filesystem store round-trips (the new tests exercise the serializers and processor directly), and any check against a deployed service.

  • Every new branch has a test that fails without it (rule 4), apart from the invocation-projection length check, which has no dedicated test
  • For a bug fix: the first commit adds a test that fails on the current code (rule 5). The test and the fix are in one commit.
  • Every edited test expectation is listed in the description, with the reason (rule 5): none were edited

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@MaxonT
MaxonT deployed to ai-pr-review-runtime November 28, 2026 01:47 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
ai-pr-review-runtime — f7411b69 Deployed Nov 28, 2026 by MaxonT via notify / Generate notification summary #515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing]: Match ReplayChildren lifecycle and wire representation

1 participant