Skip to content

feat: add Nexus integration - #768

Open
xepozz wants to merge 13 commits into
masterfrom
nexus-new
Open

feat: add Nexus integration#768
xepozz wants to merge 13 commits into
masterfrom
nexus-new

Conversation

@xepozz

@xepozz xepozz commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What was changed

Samples: temporalio/samples-php#75

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

Comment thread src/Workflow/NexusOperationOptions.php
/**
* Description of the workflow that backs a Nexus operation.
*/
final class WorkflowHandle

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I was a little confused by the naming here as it felt a bit like this was a reference to a running workflow, but it's actually the input to a start workflow call.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This mirrors java's io.temporal.nexus.WorkflowHandle naming
If you think that we should rename it, please suggest alternatives

Comment thread src/Internal/Nexus/NexusTaskHandler.php Outdated
Comment thread src/Internal/Nexus/NexusTaskHandler.php
xepozz added 6 commits July 10, 2026 09:23
…n timeouts

Address PR #768 review:
- deadlineFromHeaders parses Request-Timeout only (operation timeout is the
  total budget, left in forwarded headers); applied to cancel context too
- add scheduleToStart and startToClose timeouts to NexusOperationOptions
Tasks 1-4 of the Nexus post-merge cleanup:
- Add/sync the docs/ tree and CLAUDE.md to the committed handler model
  (drop deleted #[OperationCancel]/SynchronousOperationHandler references,
  fix the Nexus:: accessor table and #[AsyncOperation] return contract).
- Remove comment-rule violations from branch-added Nexus files; expand
  abbreviations ($u/$m -> $uriParts/$pathMatches, etc.).
- Home the shared endpoint/service override on
  ExecuteNexusOperationInput::effectiveOptions(), dropping the duplicated
  effectiveNexusOptions()/effectiveOptions() helpers.
- Unify the empty endpoint/service error paths: drop the raw assert() and
  constructor validation so NexusOperationStub::assertOperationParams() is
  the single source of truth.
Task 5 — fix the NexusOperationStub start-handshake rejection: extract
handleFromStarted() and, when the started-promise rejects, consume the
result-promise so its rejection is not left unhandled. Add regression tests
covering both the rejection surfacing and the no-leak guarantee.

Task 6 — test-convention drift across tests/Nexus and tests/Unit/Nexus:
expectExceptionMessageMatches -> full-message assertions, add missing
#[CoversClass], and strip stray test-body comments.
Task 7 — add tests/Arch/NexusDependencyTest.php enforcing that Nexus\*
depends only on Common/Exception/Workflow, with a verified exemption list
for the bridge types that legitimately reach Client\*/Internal\* (the
Handler/Internal dispatch subtree plus Nexus, Header, NexusOperationContext,
WorkflowHandle). Document the exemption in CLAUDE.md.
Task 8 — verified the ErrorType wire values against nexus-rpc/sdk-go: the
values are canonical, so no behavior change. Only document that Unknown is a
local decode fallback for unrecognized incoming types (never emitted on the
wire); every other case is a spec-defined value.
@xepozz
xepozz marked this pull request as ready for review July 20, 2026 18:41
@xepozz
xepozz requested review from a team, roxblnfk and wolfy-j as code owners July 20, 2026 18:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0d85d80b05

ℹ️ 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".

Comment on lines +59 to 63
$context->getClient()->send(new CommandResponse(
command: self::COMMAND_VALIDATED,
options: ['id' => $updateId],
payloads: null,
failure: null,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve JSON-codec support for update responses

With the default JSON codec (WorkerFactory::createCodec() selects JsonCodec when RR_CODEC is unset), any workflow update now sends CommandResponse, but JsonCodec\Encoder has no CommandResponse branch and throws Unserializable command type ...CommandResponse. The previous UpdateResponse was the only type used here and was handled by the old protocol encoder; consequently update validation and completion fail for existing JSON-codec workers.

Useful? React with 👍 / 👎.

shanginn pushed a commit to shanginn/sdk-php that referenced this pull request Jul 30, 2026
…n timeouts

Address PR temporalio#768 review:
- deadlineFromHeaders parses Request-Timeout only (operation timeout is the
  total budget, left in forwarded headers); applied to cancel context too
- add scheduleToStart and startToClose timeouts to NexusOperationOptions
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