LangChain
- Root output: Reasoning content blocks become the answer string on the root trace output. The generation span keeps the full block list. Tool-call payloads stay unchanged.
- Empty results: A successful non-root chain or tool that returns
Noneends with{"result": "none"}. Root traces and errors are unchanged.
LangChain
- Idle traces: An open trace with no activity for
open_trace_ttl(default 2 hours) is finalized and sent. A long-running loop is not closed mid-run. The sweep runs from chain, model, and tool starts, at most once per eviction interval.
Tracing
- Before send:
before_sendcan redact or drop an ingest payload without a custom HTTP transport. - Payload cap:
max_payload_bytescaps the payload.deduplicate_span_contentshrinks repeated history before the cap is applied.
LangChain
- Span filter:
exclude_span_namesandinclude_spandrop spans, including noisy LangGraph middleware, while children stay attached to the nearest kept ancestor. - Model name: When a chat model is not serializable, the handler reads
ls_model_namefrom run metadata after invocation params.
Ingest
- User-Agent: A custom
transportsendsuselemma-tracing/<version>unless you setUser-Agentyourself.
LangChain
- LangSmith middleware: When LangSmith wraps LangChain middleware and skips
on_chain_start, nested callbacks stay on the active turn instead of becoming extra root traces.
Tool calls
- Failure payloads: A tool result with
success: falseorstatusoferrororfailedis recorded as an error. The span usesstructuredContent.errorwhen that field is set.
LangChain
- Callback flags: The handler subclasses LangChain’s callback base when
langchain_coreis installed, and setsrun_inlineplus the other 1.x flags. LangChain 1.6 can call the handler without crashing before a span is recorded.
Generations
- Token counts: Non-finite numbers, including infinity, are dropped from numeric usage fields.
Tracing
- One turn, two processes: start_turn,
attach_turn, andapplyrecord a host and a sandbox as one trace. The child keeps a journal and does not call ingest. The host sends once.turn.end()still raises on failure.
Generations
- Model identity: A typed generation span copies the model from the invocation, the response, or response metadata when params omit it. The model is omitted on end when it is still unset. Completion text is not used as a model id.
Tool calls
- Encoded failures: A tool payload that encodes a failure is stored as a span error.
Generations
- Token usage: LangChain and OpenAI Agents record token usage, including cache and reasoning tokens from Agents SDK details.
- Provider: Generation spans set the provider system from the model provider.
Tracing
- Release: Pass
releaseto the client, or setLEMMA_RELEASE, to stamp the running revision on each trace. - Provenance: Spans record the SDK language and integration so missing usage is distinct from a real zero.
Tracing
- Inputs and outputs: Prompts, tool inputs, tool outputs, model output, and error messages are always recorded. The
record_inputsandrecord_outputsarguments are removed. Passing them raisesTypeError. Redact sensitive values before they reach the agent.
Tracing
- Error messages: Empty and missing failure text uses the same message in the Python and TypeScript SDKs. Serialized payloads use compact JSON.
Ingest
- User-Agent: SDK HTTP requests send
uselemma-tracing/<version>.
Tool calls
- User-facing text: Set
user_facing_messagewhen a tool sends text directly to the person. Lemma shows that text as the message they received.
OpenAI Agents
- Trace contract: The processor records current-turn input and output, terminal errors, and span-bounded times. Soft tool errors are included.
LangChain
- Trace contract: Owned runs keep current-turn input, output, and errors. Tool calls stay nested under one root until the final answer. LangGraph uses the LangChain adapter.
Tool calls
- MCP errors: A tool result with
isErroris recorded as an error, without an invented output. - Child timing: A tool span no longer ends after its parent generation.
Ingest
- One delivery: The
replaceoption is removed. Each execution sends one complete trace. Patching a trace over time is not supported.
Tracing
- Environment field: The undocumented
environmentclient field is removed.
Debug
- Ingest status:
LEMMA_DEBUG_VERIFYchecksGET /traces/ingest-statusfor up to 15 seconds, so a backlog does not look like a missed delivery. - Debug flag:
LEMMA_DEBUG=1is the preferred value.truestill works.
Debug
- Delivery logs: Debug mode logs client config and ingest responses, including failure hints.
- Smoke test: Debug verification checks that a trace reached Lemma.
Ingest
- Send on end: Trace handles and the OpenAI Agents processor send a trace once, when it ends. They no longer send partial snapshots along the way.