Serialization context changes in anticipation of Standalone Activity#1155
Open
dandavison wants to merge 1 commit intomainfrom
Open
Serialization context changes in anticipation of Standalone Activity#1155dandavison wants to merge 1 commit intomainfrom
dandavison wants to merge 1 commit intomainfrom
Conversation
| namespace: str | ||
| """Namespace used by the worker executing the workflow.""" | ||
|
|
||
| workflow_id: Optional[str] |
Contributor
There was a problem hiding this comment.
Should this be optional in WorkflowSerializationContext?
|
|
||
|
|
||
| test_traces: dict[str, list[TraceItem]] = defaultdict(list) | ||
| test_traces: dict[Optional[str], list[TraceItem]] = defaultdict(list) |
Contributor
There was a problem hiding this comment.
Unrelated to this change, but a quick glance makes it seem like we might be able to move this global state into individual tests. If possible I'd prefer that vs tests calling del test_traces[] to clean up their expected entries.
cretz
reviewed
Nov 17, 2025
| namespace: str | ||
| """Namespace used by the worker executing the activity.""" | ||
|
|
||
| activity_id: Optional[str] |
Member
There was a problem hiding this comment.
I think we should consider waiting to do this until we're implementing standalone activities in Python instead of ahead of time. That way if the implementer encounters anything while implementing standalone activities that can affect this, they can adjust accordingly.
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.
Eliminate shared base class -- it's not appropriate in the future when
ActivitySerializationContextwill be applied at the top level (and even in the original workflow-activity case, we moved away from nested scopes)Make workflow identifiers optional in activity context
Add activity ID to activity context
Note
Restructures workflow/activity serialization contexts (removing shared base), makes workflow IDs optional, adds activity IDs, and updates workers/runtime/tests to construct and assert the new contexts.
BaseWorkflowSerializationContext;WorkflowSerializationContextnow directly extendsSerializationContextwithnamespaceand optionalworkflow_id.ActivitySerializationContext: addactivity_id, includenamespace, and makeworkflow_id/workflow_typeoptional; add field docstrings.worker/_activity.pyand_workflow_instance.pyto the new shapes and to populateactivity_id.activity_idto activity executions and expected context dicts; relax types (e.g., trace map key to Optional[str]).EventWorkflowtoWaitForSignalWorkflowin async activity completion test and update signal calls accordingly.Written by Cursor Bugbot for commit 89b721a. This will update automatically on new commits. Configure here.