Repository navigation
Support LangSmith agent destinations and replica routing in TypeScript - #314
Merged
Merged
Conversation
patbeqo
reviewed
Nov 3, 2026
| // No propagated parent: run the body with no ambient run by design (nothing to attach to). | ||
| return parent ? withRunTree(parent, () => next(input)) : next(input); | ||
| // Without a parent, an invisible factory supplies defaults to independent root traceables. | ||
| return withRunTree(parent ?? rootRunTree(config), () => next(input)); |
Contributor
There was a problem hiding this comment.
If there's no parent, can this just default to the plugin's destination like Python, without a placeholder root?
patbeqo
approved these changes
Nov 9, 2026
patbeqo
added a commit
that referenced
this pull request
Nov 13, 2026
Follow-up to #314. Brings the TypeScript LangSmith plugin in line with the Python plugin. ## What changed - **Same runs as Python.** Plugin runs record no Temporal arguments or results, end with `{status}`, and treat continue-as-new and cancellation as statuses, not errors. Errors read `ClassName: message`, and Nexus handler runs are `tool` runs. - **Same trace shape.** Client markers span their call and record its error. Update-with-start propagates to the update, signals nest beside their marker, and runs carry Temporal ID metadata and the plugin's tags. Metadata is no longer scrubbed. - **Replay-safe IDs and times.** Workflow run IDs are UUIDv7 from Workflow time and the plugin's random stream; queries and validators get random IDs. Start and end times come from the Worker's clock when live. - **Ordered, logged writes.** An update can't reach LangSmith before its create, and failed writes are logged. - **ESM Workflows are traced.** `langsmith` imports in the Workflow bundle resolve to the patched CommonJS build. - **A propagated parent keeps tracing on** when `LANGSMITH_TRACING` is off, like Python. - **Fails loudly when LangSmith changes.** Worker setup fails if a patched `RunTree` method is missing. Plugin run inputs no longer include Temporal arguments, which changes what existing users see in LangSmith. ## Not in this PR - `langsmith` 0.11 support. The `address` option breaks on 0.11 and needs its own change. - LangChain and LangGraph inside Workflows, until a TypeScript LangGraph plugin exists. ## Testing - `pnpm run lint` and `pnpm test` pass (176 tests). - Each new test fails when its change is reverted.
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.
Add agent/environment destinations and write replicas to the TypeScript LangSmith integration. An optional
addressis mutually exclusive withprojectName; destinations and sanitized replica routing follow traces through Activities, child Workflows, and Nexus, including withaddTemporalRuns: false. Credentials and client objects stay local to each process.Make native
RunTreeconstruction and writes replay-safe withinstallRunTreeOverrides, scoped to Workflow handlers. Roots remain real roots, and LangSmith retains child creation, destination inheritance, and replica serialization. IDs use the existing independent random stream, timestamps use Workflow time, and writes use Worker sinks with replay suppression. Read-only handlers use the unsafe random source without advancing the recorded stream.TypeScript companion to #115. Agent addressing requires LangSmith 0.10.8 or later within the supported peer range and the workspace-enabled LangSmith beta.
Validation on Node 24.22.1 / LangSmith 0.10.8: