Skip to content

[Brook] Added a Worker option that passes a worker extension to Core. - #323

Closed
moetemp wants to merge 2 commits into
moe/brook/v3/p0-core-pinfrom
moe/brook/v3/p1-worker-extension
Closed

moetemp wants to merge 2 commits into
moe/brook/v3/p0-core-pinfrom
moe/brook/v3/p1-worker-extension

Conversation

@moetemp

@moetemp moetemp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR adds a WorkerExtension and a Worker extension option. The Worker passes the extension to Core's WorkerConfig.extension. The bridge builds an extension from a name and encoded config. Only the extensions that the bridge build links are known. Debug builds link a small temporalio-test extension for the SDK's own tests, and release builds leave it out.

The sdk-core pin moves to the Brook v3 Core head (moe/brook/v3/c4-local-activity-workflow-task), which has the WorkerExtension trait and ActivityTask.Start.workflow_task.

Why?

Core calls a WorkflowTaskInterceptor around each Workflow Task completion, and only native code can give Core one. Python options can't carry a Rust object, so the bridge builds it by name and the option carries the bridge's handle. The extension must run on the client's runtime, so the Worker checks that.

How did you test it?

pytest tests/worker/test_extension.py. The tests run a Workflow with an extension that lets each task complete, and one whose before_complete fails the task.

  • Unit Tests
  • Staging
  • End to End Tests

Core calls a WorkerExtension around each Workflow Task, and only native code can build one. So the bridge builds an extension by its name, and the Worker passes it to Core. The Core pin moves to the Brook v3 c4 head, which has the trait.
Lane C's review fixes moved c4. The crate pins the same sdk-rust commit, and the two must match.
@moetemp

moetemp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This layer is folded into the v5 tip, #365, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f

@moetemp moetemp closed this Oct 25, 2026
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.

1 participant