Skip to content

feat: support updated operation IDs in replay#504

Merged
zhongkechen merged 1 commit into
mainfrom
codex/updated-operation-ids-plugin-hooks
Jul 3, 2026
Merged

feat: support updated operation IDs in replay#504
zhongkechen merged 1 commit into
mainfrom
codex/updated-operation-ids-plugin-hooks

Conversation

@zhongkechen

Copy link
Copy Markdown
Contributor

Summary:

  • Add UpdatedOperationIds to DurableExecutionInvocationInput and pass it into ExecutionState.
  • Emit plugin operation update/end hooks for operations changed while suspended instead of replay start/end hooks.
  • Teach the local testing backend to carry updated operation IDs across resumed invocations.

Validation:

  • hatch fmt --check
  • hatch run dev-core:typecheck
  • hatch run dev-testing:typecheck
  • hatch run dev-core:test packages/aws-durable-execution-sdk-python/tests/execution_test.py packages/aws-durable-execution-sdk-python/tests/context_test.py
  • hatch run dev-testing:test packages/aws-durable-execution-sdk-python-testing/tests/execution_test.py packages/aws-durable-execution-sdk-python-testing/tests/invoker_test.py
  • hatch run dev-otel:test

@zhongkechen zhongkechen force-pushed the codex/updated-operation-ids-plugin-hooks branch 2 times, most recently from da2e7c7 to a8acb74 Compare July 2, 2026 18:28
Comment on lines +521 to +522
if not was_updated:
self.state.emit_operation_replay_hook(next_checkpoint.operation)

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.

if on_operation_start and on_operation_end is emitted on every invocation, how does that affect the Otel plugin's spans?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replay is true so existed is true. The spans on replay will be created with links to the spans in the previous invocation.

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.

I guess I'm asking whether all spans from previous replays will be recreated for each invocation or if they will only be present for invocations where they are relevant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only in invocations they are relevant

with self._updated_operation_hooks_lock:
if operation.operation_id in self._updated_operation_hooks:
return True
self._updated_operation_hooks.add(operation.operation_id)

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.

why do we need to update this _updated_operation_hooks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, deduplication logic here is redundant. Removed.

@zhongkechen zhongkechen force-pushed the codex/updated-operation-ids-plugin-hooks branch 4 times, most recently from dadb4e3 to a972088 Compare July 2, 2026 19:01
@zhongkechen zhongkechen force-pushed the codex/updated-operation-ids-plugin-hooks branch from a972088 to 37add3f Compare July 2, 2026 19:07
@zhongkechen zhongkechen changed the title Support updated operation IDs in replay feat: support updated operation IDs in replay Jul 2, 2026
@zhongkechen zhongkechen merged commit 0375c28 into main Jul 3, 2026
76 of 77 checks passed
@zhongkechen zhongkechen deleted the codex/updated-operation-ids-plugin-hooks branch July 3, 2026 16:53
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.

3 participants