ref!: Remove plugins as part of public API - #2386
Open
Luca Forstner (lforst) wants to merge 5 commits into
Open
Conversation
…ed36b547c4 # Conflicts: # js/src/exports.ts # js/src/instrumentation/index.ts # js/src/instrumentation/providers/eve-instrumentation.test.ts
Luca Forstner (lforst)
added a commit
that referenced
this pull request
Aug 24, 2026
LangChain's `UsageMetadata` carries `output_token_details.reasoning`, and nothing in `js/src` or `integrations` read it. `completion_tokens` covers the spend, so what was lost is the breakdown: no way to see how much of a reasoning model's output went to thinking, on any LangChain or LangGraph span. Mapped `reasoning` only. `js/src/wrappers/mastra.ts:164-172` settles the scope, picking up the non-modality detail fields (`cacheRead`, `cacheWrite`, `reasoning`) and leaving the modality ones alone. `OutputTokenDetails` also carries `audio`, `image`, `video`, `document` and `text` through `ModalitiesTokenDetails`; the input side drops its copies too, so those are a separate change. Zero is recorded, not dropped, matching `prompt_cached_tokens: 0` in the existing snapshots. `js/src/instrumentation/plugins/langsmith-plugin.ts:456` has the same gap. Left alone because #2386 is moving that tree. Snapshot churn is 30 added lines across 10 files, every one `completion_reasoning_tokens`, both sides of each span-tree pair regenerated, no deletions. Ran `pnpm test` in `js/` (1648 passed), `check:typings`, `lint`, and `test:e2e:update` then `test:e2e` once each, not twice. On that assert pass `scenarios/git-metadata` timed out at 30s under parallel load. It passes in isolation here in 1.19s and on `main` in 1.20s, and the two scenarios this change touches pass, so I read it as local contention. Worth confirming on CI. Both new unit tests fail against `main` on assertions. --------- Co-authored-by: Dylan Pulver <dylanpulver@users.noreply.github.com> Co-authored-by: lforst <8118419+lforst@users.noreply.github.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.
ref braintrustdata/braintrust-sdk-javascript#1841
Removes Plugins and unsubscribe functionality.
Reasoning: Plugins are a bit of an unnecessary API to be exposed because they just attach stuff and un-attach stuff. The user can very easily just manage this by themselves. Also, unsubscribe is literally called from nowhere in the SDK.