Skip to content

fix(sdk): serialize context Error and ReplayChildren#478

Merged
yaythomas merged 1 commit into
mainfrom
fix/context-details-serialization
Jun 17, 2026
Merged

fix(sdk): serialize context Error and ReplayChildren#478
yaythomas merged 1 commit into
mainfrom
fix/context-details-serialization

Conversation

@yaythomas

Copy link
Copy Markdown
Contributor

What

Operation.to_dict now includes Error and ReplayChildren in ContextDetails when they are set. It previously emitted only Result.

Why

ContextDetails.from_dict reads Result, Error, and ReplayChildren, and the checkpoint update serializer writes them. Operation.to_dict was the only place that dropped Error and ReplayChildren, so serialized operation state did not round trip.

Scope of impact

This does not change core SDK runtime behavior for callers. Operation.to_dict serializes operation state to feed a handler, which the local test runner does. Normal published SDK execution does not call it on that path. The impact is confined to the local test runner, where a serialized child context failure reconstructed as a generic error and a large payload child context lost its ReplayChildren marker.

Testing

Two unit tests added in tests/lambda_service_test.py. One asserts Error and ReplayChildren appear when set. One asserts they are omitted when absent. Full core suite passes (1272), types clean (63 files), format clean.

Closes #477

Operation.to_dict dropped Error and ReplayChildren from ContextDetails
and emitted only Result. The read path (ContextDetails.from_dict) and
the checkpoint update serializer already handle both fields, so
serialized operation state did not round trip through Operation.to_dict.

Include Error and ReplayChildren when present. A serialized child
context failure now reconstructs the correct error class on replay, and
a large payload child context keeps its ReplayChildren marker.

The impact is confined to code that serializes operation state to feed
a handler, which the local test runner does. Normal published SDK
execution does not call Operation.to_dict on this path, so core runtime
behavior for callers is unchanged.

Closes #477
@yaythomas yaythomas merged commit a0dc691 into main Jun 17, 2026
67 of 70 checks passed
@yaythomas yaythomas deleted the fix/context-details-serialization branch June 17, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Operation.to_dict drops Error and ReplayChildren from ContextDetails

2 participants