Add support for Stand Alone Nexus Operations#2280
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3fe42e708a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // ID - The business identifier of the operation. | ||
| // | ||
| // Mandatory: No default. | ||
| ID string |
There was a problem hiding this comment.
Rename start option field to OperationID for API consistency
ClientStartNexusOperationOptions introduces an ID field while the rest of the new Nexus API uses OperationID (GetNexusOperationHandleOptions, metadata structs, and the integration test callsites). This inconsistency makes normal usage patterns fail at compile time (unknown field OperationID) and effectively breaks the newly added standalone Nexus start API for callers who follow the surrounding API naming. Aligning this field name now avoids shipping an immediately incompatible public surface.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is to be consistent with Stand alone activities naming approach
|
Note this PR is missing support for otel I was planning on addressing that in a separate PR to keep the scope down |
d296109 to
8d6e09e
Compare
e77a1be to
0fb81e4
Compare
0fb81e4 to
1da6fb7
Compare
| } | ||
| } | ||
|
|
||
| func (w *workflowClientInterceptor) DescribeNexusOperation( |
There was a problem hiding this comment.
Should cancel, describe, and terminate check that the operation ID is not empty?
VegetarianOrc
left a comment
There was a problem hiding this comment.
Couple of questions, but looks good!
| DISABLE_SERVER_1_27_TESTS: "1" | ||
| DISABLE_PRIORITY_TESTS: "1" | ||
| DISABLE_STANDALONE_ACTIVITY_TESTS: "1" | ||
| DISABLE_STANDALONE_NEXUS_TESTS: "1" |
There was a problem hiding this comment.
This is following the existing pattern, but should we be defaulting to exclude all these tests in CI? Or maybe I am misunderstanding the setup.
There was a problem hiding this comment.
We should definitely revisit how we do this, last time I checked there was definitely some that could be removed at this point. I can add to TODO for myself
There was a problem hiding this comment.
The logic here just excludes when we are using docker to test since the docker tests don't use the pre-release CLI
| _, err := nexusclient.ExecuteOperation(ctx, nc, syncOp, "timeout", nexus.StartOperationOptions{ | ||
| // Force shorter timeout to speed up the test and get a response back. | ||
| Header: nexus.Header{nexus.HeaderRequestTimeout: "300ms"}, | ||
| Header: nexus.Header{nexus.HeaderRequestTimeout: "5s"}, |
There was a problem hiding this comment.
Is this change needed/related? Was 300ms too aggressive and causing flakes?
There was a problem hiding this comment.
Yeah, specifically the endpoint registry is eventually consistent right now so under load it can take too long for the endpoint to become visible
|
|
||
| // NexusClient is the client for starting Nexus operations bound to a specific endpoint and service. | ||
| // This is for standalone Nexus operations outside of workflow context. | ||
| // For Nexus operations within workflows, use workflow.NexusClient. |
There was a problem hiding this comment.
Do we want to also mention in workflow.NexusClient that we have client.NexusClient for standalone operations?
1da6fb7 to
fe11924
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.
Reviewed by Cursor Bugbot for commit fe11924. Configure here.
fe11924 to
8408739
Compare

Add standalone Nexus operation support
Adds the ability to start, poll, describe, cancel, terminate, list, and count Nexus operations directly from the
client, outside of workflow context. This mirrors the standalone activity pattern and is based on the API we already reviewed the cross SDK design for.
API
Interceptor support
Adds 6 methods to ClientOutboundInterceptor: ExecuteNexusOperation, GetNexusOperationHandle, CancelNexusOperation,
TerminateNexusOperation, DescribeNexusOperation, PollNexusOperationResult. List and Count bypass the interceptor,
consistent with standalone activities.
Testing
Note
Medium Risk
Adds new experimental client APIs and interceptor hooks for starting/polling/canceling Nexus operations, which touches core client surface area and gRPC request handling. Risk is mitigated by new unit/integration coverage but may impact compatibility for custom interceptors/mocks.
Overview
Adds experimental standalone Nexus operation support to the public
clientAPI, includingNewNexusClient,NexusClient.ExecuteOperation,NexusOperationHandle(get/describe/cancel/terminate), plusListNexusOperationsandCountNexusOperationsvisibility queries.Implements the feature end-to-end in
internal/internal_nexus_client.gowith new gRPC calls, typed options/metadata structs, operation-name resolution, and long-poll result retrieval; extendsClientOutboundInterceptorwith Nexus-related methods and updates mocks/tests accordingly.Updates integration/unit tests to cover the new standalone flow (including endpoint provisioning, handle behaviors, cancel/terminate, list/count) and adjusts CI/dev-server config to use a Nexus-capable dev server and to optionally disable the new tests.
Reviewed by Cursor Bugbot for commit 8408739. Bugbot is set up for automated code reviews on this repo. Configure here.