ref(langchain)!: Move LangChain and LangGraph integrations to @sentry/server-utils - #22962
Draft
nicohrubec wants to merge 1 commit into
Draft
ref(langchain)!: Move LangChain and LangGraph integrations to @sentry/server-utils#22962nicohrubec wants to merge 1 commit into
@sentry/server-utils#22962nicohrubec wants to merge 1 commit into
Conversation
Contributor
size-limit report 📦
|
…y/server-utils`
Move the LangChain and LangGraph gen-ai instrumentation from `@sentry/core` to
`@sentry/server-utils/src/ai/{langchain,langgraph}`, consuming the shared `ai/core`
base. The public helpers (`createLangChainCallbackHandler`, `instrumentLangChainEmbeddings`,
`instrumentStateGraph`, `instrumentStateGraphCompile`, `instrumentCreateReactAgent`) are
re-exported from `@sentry/server-utils` by node/cloudflare/vercel-edge, so the platform
SDK public API is unchanged.
LangChain and LangGraph move together because core's LangGraph imports functions and
types from LangChain (`createLangChainCallbackHandler`, `normalizeLangChainMessages`,
`_INTERNAL_mergeLangChainCallbackHandler`, `BaseChatModel`/`LangChainMessage`); splitting
them across PRs would require a temporary core->server-utils import (circular dep) or
duplicated code. Moving both keeps LangGraph on relative `../langchain` imports.
As with the other providers, `vercel-edge` re-exports from
`@sentry/server-utils/no-diagnostic-channels` to keep the edge build free of
`node:diagnostics_channel`.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nicohrubec
force-pushed
the
ref/move-ai-langchain-langgraph-2
branch
from
August 3, 2026 15:37
dd86ee6 to
4355a4a
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.
Move the LangChain and LangGraph gen-ai instrumentation from
@sentry/coreto@sentry/server-utils/src/ai/{langchain,langgraph}, consuming the sharedai/corebase. The public helpers are re-exported from@sentry/server-utilsby node/cloudflare/vercel-edge, so the platform SDK public API is unchanged.LangChain and LangGraph are moved together in one PR because core's LangGraph imports functions and types from LangChain (
createLangChainCallbackHandler,normalizeLangChainMessages,_INTERNAL_mergeLangChainCallbackHandler,BaseChatModel/LangChainMessage). Splitting them across PRs would require either a temporary@sentry/core→@sentry/server-utilsimport (the circular dep this whole refactor avoids) or throwaway duplicated code in core. Moving both keeps LangGraph on relative../langchainimports — the final clean state.As with the other providers,
vercel-edgere-exports from@sentry/server-utils/no-diagnostic-channelsto keep the edge build free ofnode:diagnostics_channel.🤖 Generated with Claude Code