You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LangChain callback handler keeps runs that never end in memory #25510
createLangChainCallbackHandler() tracks each run in a map until its end or error callback fires. If LangChain never calls either, for example when a consumer abandons a stream, the entry and its span stay in the map forever. The auto-instrumentation path shares one handler for the whole process, so these add up. This predates #25364 (spanMap had it). Since #25364 each entry also holds the span that was active when the run started, which can keep a caller span outside the run's own tree alive.
Options: drop entries whose span has already ended when a new run starts, cap the map size, and store the active span's id instead of the span object.
Activity
linear-code commentedon Oct 19, 2026
JS-3958