AI-281: add @temporalio/langsmith samples#480
Open
xumaple wants to merge 1 commit into
Open
Conversation
c31ac0d to
1d6f81d
Compare
DABH
approved these changes
Jun 29, 2026
889198c to
997b241
Compare
Four scenarios demonstrating the @temporalio/langsmith plugin: activity-tracing, workflow-tracing, agent-pipeline, and message-handlers. Each includes a worker, client, workflows, a mocha test, and a README.
997b241 to
f360f7c
Compare
DABH
added a commit
to temporalio/sdk-typescript
that referenced
this pull request
Jul 9, 2026
…rites
LangSmithPlugin.configureBundler installs three webpack rewrites into the
Workflow bundle (node:async_hooks -> isolate shim, langsmith node-only
utils/{fs,worker_threads}.cjs -> .browser.cjs, and a config DefinePlugin)
via require('webpack').
webpack is a dependency of @temporalio/worker, not of this plugin, so the
bare require is only resolvable when webpack is hoisted (npm, yarn, default
pnpm). Under a non-hoisting layout -- notably pnpm with hoist=false, which
samples-typescript uses -- it throws MODULE_NOT_FOUND, which the helpers
silently swallow. The langsmith redirect is then skipped, the Node-only
fs.cjs stays in the isolate bundle, and the build fails far downstream with
an opaque UnhandledSchemeError on node:fs/fs-promises/path/worker_threads
(temporalio/samples-typescript#480).
Resolve webpack through @temporalio/worker (a direct dependency of this
plugin that always carries the exact webpack the bundle is built with), so
the rewrites apply regardless of the consumer's node_modules layout -- the
same approach already used for the interceptor module via require.resolve.
Also throw an actionable error instead of silently skipping when webpack
cannot be resolved.
DABH
added a commit
to temporalio/sdk-typescript
that referenced
this pull request
Jul 9, 2026
LangSmithPlugin.configureBundler installs three webpack rewrites into the
Workflow bundle (node:async_hooks -> isolate shim, langsmith node-only
utils/{fs,worker_threads}.cjs -> .browser.cjs, and a config DefinePlugin),
acquiring webpack via require('webpack').
webpack is a dependency of @temporalio/worker, not of this plugin, so the
bare require only resolves when webpack is hoisted (npm, yarn, default pnpm).
Under a non-hoisting layout -- notably pnpm with hoist=false, which
samples-typescript uses -- it throws MODULE_NOT_FOUND, which the helpers
silently swallowed. The rewrites were skipped, langsmith's Node-only fs.cjs
stayed in the isolate bundle, and the build failed far downstream with an
opaque UnhandledSchemeError on node:fs/fs-promises/path/worker_threads
(temporalio/samples-typescript#480).
Install the rewrites from a single plugin whose apply() reads webpack off
`compiler.webpack` instead of importing it. This needs no webpack dependency,
works regardless of the consumer's node_modules layout, and uses the exact
webpack instance running the bundle -- never a second copy.
5ac220c to
f360f7c
Compare
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.
Adds samples for the
@temporalio/langsmithplugin.