[PR #2427] [MERGED] fix: propagate tracingEnabled to nested traceables #2331

Closed
opened 2026-02-15 23:17:27 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langsmith-sdk/pull/2427
Author: @hntrl
Created: 2/13/2026
Status: Merged
Merged: 2/13/2026
Merged by: @jacoblee93

Base: mainHead: hunter/run-tree-param-passthrough


📝 Commits (1)

  • 100209c fix: propagate tracingEnabled to nested traceables

📊 Changes

3 files changed (+82 additions, -2 deletions)

View changed files

📝 js/src/singletons/types.ts (+1 -0)
📝 js/src/tests/traceable.test.ts (+66 -0)
📝 js/src/traceable.ts (+15 -2)

📄 Description

Summary

Fixes a bug where nested traceable calls would still produce traces even when an ancestor traceable had tracingEnabled: false, because the ContextPlaceholder stored in AsyncLocalStorage did not carry the disabled tracing signal.

This is the langsmith-sdk side of a two-part fix: https://github.com/langchain-ai/langchainjs/pull/10044

Changes

js/src/traceable.ts

  1. getTracingRunTree: When tracing is disabled, the returned ContextPlaceholder now carries { tracingEnabled: runTree.tracingEnabled } instead of an empty {}. This preserves the disabled signal for downstream consumers.

  2. Child config inheritance: When a child traceable runs inside a parent that stored a ContextPlaceholder with tracingEnabled: false, and the child didn't explicitly set tracingEnabled, the child's config now inherits tracingEnabled: false from the parent context.

js/src/singletons/types.ts

  • Added optional tracingEnabled?: boolean property to ContextPlaceholder type so it can carry the tracing signal.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langsmith-sdk/pull/2427 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 2/13/2026 **Status:** ✅ Merged **Merged:** 2/13/2026 **Merged by:** [@jacoblee93](https://github.com/jacoblee93) **Base:** `main` ← **Head:** `hunter/run-tree-param-passthrough` --- ### 📝 Commits (1) - [`100209c`](https://github.com/langchain-ai/langsmith-sdk/commit/100209cfb20de122b018602609a2df35881b5f85) fix: propagate tracingEnabled to nested traceables ### 📊 Changes **3 files changed** (+82 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `js/src/singletons/types.ts` (+1 -0) 📝 `js/src/tests/traceable.test.ts` (+66 -0) 📝 `js/src/traceable.ts` (+15 -2) </details> ### 📄 Description ## Summary Fixes a bug where nested `traceable` calls would still produce traces even when an ancestor `traceable` had `tracingEnabled: false`, because the `ContextPlaceholder` stored in `AsyncLocalStorage` did not carry the disabled tracing signal. This is the langsmith-sdk side of a two-part fix: https://github.com/langchain-ai/langchainjs/pull/10044 ## Changes ### `js/src/traceable.ts` 1. **`getTracingRunTree`**: When tracing is disabled, the returned `ContextPlaceholder` now carries `{ tracingEnabled: runTree.tracingEnabled }` instead of an empty `{}`. This preserves the disabled signal for downstream consumers. 2. **Child config inheritance**: When a child `traceable` runs inside a parent that stored a `ContextPlaceholder` with `tracingEnabled: false`, and the child didn't explicitly set `tracingEnabled`, the child's config now inherits `tracingEnabled: false` from the parent context. ### `js/src/singletons/types.ts` - Added optional `tracingEnabled?: boolean` property to `ContextPlaceholder` type so it can carry the tracing signal. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 23:17:27 -05:00
yindo closed this issue 2026-02-15 23:17:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langsmith-sdk#2331