Enabling LangSmith tracing (LANGCHAIN_TRACING_V2=true) makes every agent run fail: "onChainEnd: Run ID … not found in run map" #15740
Unanswered
franco-teramot
asked this question in
Troubleshooting
Replies: 1 comment 1 reply
|
Langsmith is not a first-class agent tracing solution for LibreChat, even though LC Agents SDK does use Langchain primitives Will look into it soon but moved to troubleshooting due to above. All recent agent tracing initiatives revolve around Langfuse as a first-class citizen of LibreChat for agentic tracing, |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What happened?
With LangSmith tracing enabled through the standard LangChain environment variables (
LANGCHAIN_TRACING_V2=true,LANGCHAIN_API_KEY,LANGCHAIN_PROJECT), every agent run fails at its first graph step and the user gets an error bubble. No model call is made. The trace that reaches LangSmith is the failedAgentGraphroot run carrying only the error below.This happens with a minimal agent (Anthropic provider, no tools, instructions "Reply with the single word OK."), so it is not related to MCP or tools. It also happens with agents that have MCP tools attached. The moment
LANGCHAIN_TRACING_V2is unset orfalse, the same agent and the same request succeed.Also tried:
LANGCHAIN_CALLBACKS_BACKGROUND=false— no change.Title generation (
TitleRun) succeeds and is traced normally, so the tracer itself connects; it is the agent graph's streaming path that breaks.Version Information
Reproduced on both:
ghcr.io/danny-avila/librechat:v0.8.7ghcr.io/danny-avila/librechat:v0.8.8-rc2Docker Compose on macOS (Docker Desktop), MongoDB 7, no Redis, no Meilisearch, no RAG API. Config schema
version: 1.3.15.endpoints.agents.capabilities: [tools, artifacts, context, deferred_tools],toolApproval.enabled: true(also fails with a tool-less agent, where approval never triggers).Steps to Reproduce
.env:anthropic, modelclaude-sonnet-4-6, instructionsReply with the single word OK., no tools, no capabilities beyond defaults.say OKto that agent (UI, orPOST /api/agents/chat/agentswith the usual message body).AgentGraphrun with status error and the same message.LANGCHAIN_TRACING_V2=false, restart, repeat step 3: the agent answersOK.What browsers are you seeing the problem on?
Not browser related (reproduced via API with curl as well). Chrome for the UI runs.
Relevant log output
The stored assistant message has a single content part of type
error. The LangSmith root run (AgentGraph) haserror: "onChainEnd: Run ID … not found in run map."; a siblingTitleRunfor the same message succeeds.Screenshots
LangSmith project after five attempts: one green
TitleRun, five redAgentGraph/AgentRunruns, all with theonChainEnderror (available on request).Code of Conduct
All reactions