Skip to content

Implement Standalone Nexus Operations#1461

Draft
VegetarianOrc wants to merge 9 commits intomainfrom
amazzeo/sano
Draft

Implement Standalone Nexus Operations#1461
VegetarianOrc wants to merge 9 commits intomainfrom
amazzeo/sano

Conversation

@VegetarianOrc
Copy link
Copy Markdown
Contributor

@VegetarianOrc VegetarianOrc commented Apr 17, 2026

NOTE FOR REVIEWERS: This PR is pending the actual release of the API and Server and will not be merged until those are complete.

I recommend viewing this diff with the histogram diff algorithm to reduce noise and see the additions more clearly. You can view that by checking out the branch and running git diff --histogram origin/main

Add Standalone Nexus Operation Support

API Changes

  • Client.create_nexus_client() - Create a typed NexusClient from an endpoint & nexusrpc.Service
  • Client.list_nexus_operations() - List operations via visibility query
  • Client.count_nexus_operations() - Count operations via visibility query
  • Client.get_nexus_operation_handle() - Create a typed NexusOperationHandle to an existing operation
  • NexusClient.start_operation() - Start a Nexus Operation and return a NexusOperationHandle.
  • NexusClient.execute_operation() - Same as start_operation, but poll the handle for the final result.
  • NexusOperationHandle.result() / .describe() / .cancel() / .terminate() / property accessors - interact with an existing operation.
  • Supporting types like input types, enums, and errors added as appropriate.

Interceptor Support

The following methods have been added to OutboundInterceptor

  • start_nexus_operation()
  • describe_nexus_operation()
  • cancel_nexus_operation()
  • terminate_nexus_operation()
  • list_nexus_operations()
  • count_nexus_operations()

Testing

Added integration test suite tests/nexus/test_standalone_operations.py (858 lines) covering start, get result, describe, cancel, terminate, list, count, ID conflict/reuse policies, and interceptor integration

Misc Changes

  • Update ruff target version to py310 to match the minimum support Python version.

Copy link
Copy Markdown

@Evanthx Evanthx left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall!

Comment thread temporalio/api/compute/v1/config_pb2.pyi
Comment thread temporalio/client.py Outdated
Comment thread temporalio/client.py
…n defaults for id_reuse_policy and id_conflict_policy. Update integration tests with better typing and new assertions for the newly interceptable get_nexus_operation_result
Comment thread temporalio/client.py
…ch start/execute operation. Fix hardcoded retryable=True in fallback error serialization. Add type tests and rename test/nexus/test_type_errors.py to ensure that the type test file properly executes nexus tests.
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