feat(plugin): surface execution input and result on invocation hooks - #616
Draft
wangyb-A wants to merge 1 commit into
Draft
feat(plugin): surface execution input and result on invocation hooks#616wangyb-A wants to merge 1 commit into
wangyb-A wants to merge 1 commit into
Conversation
Adds InvocationInfo.execution_input (the deserialized execution input) and InvocationEndInfo.execution_result (the serialized result JSON) so instrumentation plugins can record execution I/O. Both are kw-only with None defaults, so existing plugins and callers are unaffected. Mirrors the JS SDK's InvocationInfo.executionInput / InvocationEndInfo .executionResult (the Java SDK is adding the analogous accessor in aws-durable-execution-sdk-java#596).
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.
Summary
Widens the plugin invocation hooks so instrumentation plugins can record execution
input/output:
InvocationInfo.execution_input: Any— the deserialized execution input, populated bydurable_execution()from the invocation's input eventInvocationEndInfo.execution_result: str | None— the serialized result JSON fromDurableExecutionInvocationOutput.result(Noneon failure/suspend), threaded throughfrom_durable_execution_invocation_outputBoth fields are kw-only with
Nonedefaults, so existing plugins, hook constructors,and positional callers are unaffected — this is a purely additive API widening.
Motivation
The JS SDK already exposes this data to plugins (
InvocationInfo.executionInput/InvocationEndInfo.executionResult), and its Workflow Insight plugin depends on it to emitexecution records carrying
input/output. Porting that plugin to Python (validatedagainst the cross-SDK
insightconformance suite,aws-durable-execution-conformance-tests#73) is blocked without these fields — the plugin
cannot honestly emit data the SDK never hands it. The Java SDK is adding the analogous
plugin accessor in aws-durable-execution-sdk-java#596.
Changes
src/aws_durable_execution_sdk_python/plugin.pyfrom_durable_execution_invocation_outputcarries them;PluginExecutorstart-info plumbingsrc/aws_durable_execution_sdk_python/execution.pyinput_eventinto the invocation-start plugin infotests/plugin_test.pyTesting
hatch run test:all packages/aws-durable-execution-sdk-python/tests/plugin_test.py— 70 passedhatch run test:all packages/aws-durable-execution-sdk-python/tests/execution_test.py— 82 passedhatch fmt --checkclean on all touched files18-requirement
insightconformance suite 18/18 on both record sinks (live, us-west-2)