fix: don't apply plugin workflowModules when a workflowBundle is used - #2309
Open
alexrosenfeld10 wants to merge 2 commits into
Open
fix: don't apply plugin workflowModules when a workflowBundle is used#2309alexrosenfeld10 wants to merge 2 commits into
alexrosenfeld10 wants to merge 2 commits into
Conversation
SimplePlugin.configureWorker and configureReplayWorker appended the plugin's workerInterceptors.workflowModules unconditionally. When a prebuilt workflowBundle is used, module paths cannot be applied, so the worker warned 'Ignoring WorkerOptions.interceptors.workflowModules' on every startup, even in the documented setup where the plugin was also passed to bundleWorkflowCode (which is what actually includes the interceptors in the bundle). The plugin now skips injecting its workflowModules when the resolved options contain a workflowBundle; user-provided workflowModules are passed through untouched. Fixes temporalio#2278 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mjameswh
reviewed
Aug 12, 2026
| workflowBundle: resolveParameter(options.workflowBundle, this.options.workflowBundle), | ||
| interceptors: resolveWorkerInterceptors(options.interceptors, this.options.workerInterceptors), | ||
| workflowBundle, | ||
| interceptors: resolveWorkerInterceptorsForOptions(options, workflowBundle, this.options.workerInterceptors), |
Contributor
There was a problem hiding this comment.
- Let's reverse the gate condition: only include
workflowModulesinterceptors if there's aworkflowsPath; that means that a worker with noworkflowBundleand noworkflowsPath(i.e. non-workflow worker) should not receive anyworkflowModules. - Please follow the same arg structure/order as other
resolveXxxmethods; the gate condition should be last and should be a boolean (maybeincludeWorkflowModules?). - I'd argue the extra intermediary resolve function brings no value, yet makes the logic harder to process mentally.
Suggested change
| interceptors: resolveWorkerInterceptorsForOptions(options, workflowBundle, this.options.workerInterceptors), | |
| interceptors: resolveWorkerInterceptors(options.interceptors, this.options.workerInterceptors, resolvedWorkflowsPath != null), |
Author
There was a problem hiding this comment.
Reworked in 9c9958d: gate reversed to workflowsPath presence (so non-workflow workers get no workflowModules either), passed as a trailing boolean on resolveWorkerInterceptors, and the intermediary resolve function is removed.
One note on the implementation: since resolveParameterWithResolution returns the parameter directly when existing is undefined (the common case where the user passes no interceptors), the gate strips workflowModules from the object-form parameter up front rather than inside the merge callback. Function-form parameters keep full control of the result, consistent with the other resolvers.
Address review feedback: reverse the gate so the plugin's workflowModules are only appended when the resolved options contain a workflowsPath. Workers with no workflowsPath and no workflowBundle (non-workflow workers) no longer receive them either. The gate is a trailing boolean on resolveWorkerInterceptors and the intermediary resolve function is removed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
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.
What was changed
SimplePlugin.configureWorkerandconfigureReplayWorkerno longer inject the plugin'sworkerInterceptors.workflowModulesinto worker options when the resolved options contain aworkflowBundle. User-providedinterceptors.workflowModulesare passed through untouched, so the worker's existing warning still fires for explicit user misconfiguration.Why?
Fixes #2278.
SimplePluginappendedworkflowModulesunconditionally, so any plugin that ships workflow interceptor modules (e.g.OpenTelemetryPlugin) triggered this on every worker startup when used with a prebuilt bundle:This happened even in the documented setup where the plugin was also passed to
bundleWorkflowCode(which is what actually includes the interceptors in the bundle, viaconfigureBundler). Module paths cannot be applied to a prebuilt bundle, so injecting them into worker options serves no purpose in that configuration.Checklist
Closes [Bug] OpenTelemetryPlugin + prebuilt workflowBundle always logs "Ignoring WorkerOptions.interceptors.workflowModules" at worker startup #2278
How was this tested:
packages/test/src/test-plugins.tscovering: modules still appended withworkflowsPath; not injected when aworkflowBundleis passed in options or provided by the plugin itself; user-provided modules passed through; same behavior forconfigureReplayWorker. Test was written first and observed failing against the previous behavior.bundleWorkflowCodewithOpenTelemetryPlugin(fromcontrib/interceptors-opentelemetry-v2) followed byWorker.createwith the prebuilt bundle and the plugin, capturing runtime logs. Before the fix the warning is logged; after the fix it is not, and the bundle contains the OTel workflow interceptors.test-plugins.jssuite passes locally.workerInterceptorsoption doc inSimplePluginOptionsto describe the behavior.🤖 Generated with Claude Code