-
Notifications
You must be signed in to change notification settings - Fork 104
Initial version of nexus_operation_as_tool #932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
dandavison
wants to merge
184
commits into
main
Choose a base branch
from
nexus-operation-as-tool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+6,501
−61
Conversation
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
Import types from nexusrpc Rename: WorkflowRunOperation Use Client.start_workflow with Temporal-specific context classes Use temporal {Start,Cancel}OperationContext Handle errors during cancellation Failing test for requestID-based idempotency Propagate Nexus request ID when starting a workflow Move nexus http client into tests/helpers Testing: Fix env http port Test that Nexus request ID becomes Temporal StartWorkflow request ID Test non-serializable operation output Don't require HandlerError cause and fix test assertions Respond to upstream: Unknown{Operation,Service}Error are just HandlerError Rename argument in public Worker API: nexus_service_handlers Respond to upstream: Executor rename Sync/Async suffix names Separate _TemporalNexusOperationContext from Nexus op ctx _operation_handlers module Make TemporalNexusOperationContext public Add WorkflowRunOperationResult.to_workflow_handle
Pass nexus_operation to start_workflow. But this seems problematic. The user may forget. But it seems that we have no way to prevent them from forgetting since as far as start_workflow knows this may be a valid start_workflow call in a Nexus operation handler, precdeding the "final" / "backing" start_workflow call.
This reverts commit 334b889fd196d1412b264c9197762645027cea22.
This reverts commit 1a74d64.
The only way to start a nexusified workflow is to create a WorkflowStartOperationResult, passing it an Awaitable[WorkflowHandle]. Accordingly, you must go via this type to create a token encoding a nexusified worfklow handle. The method decorated by the shorthand decorator @workflow_run_operation_handler must return WorkflowStartOperationResult. A manually-implemented OperationHandler start method may create a token this way.
NexusStartWorkflowRequest holds start_workflow request params, and exposes a method to start the workflow that injects the required Nexus metadata, and populates outbound links.
tctx.start_workflow starts the workflow, injects Nexus metadata, but returns a WorkflowOperationToken instead of a WorkflowHandle. This means that users accidentally trying to start a Nexusified workflow via the standard client.start_workflow will get both a type-check-time error, and a run-time error.
- Move NexusCompletionCallback into client.py
9a10b13
to
917873c
Compare
vendor function_schema and use supplied global namespace when resolving type hints
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.
This PR adds one commit on top of the
nexus
branch.The
nexusrpc
Nexus SDK is not yet released; this branch installs it from GitHub currently.