Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

LangChain callbacks can appear to hide a sub-agent failure for several different reasons: callback configuration may not reach a child run, an error may be converted into a tool result or follow a separate control-flow path, or the child may simply omit the failure from its final message. These are different problems, so a parent agent’s success event or final answer alone does not prove that every delegated operation succeeded.

Why are my LangChain callbacks not firing?

LangChain’s RunnableConfig reference describes callbacks as applying to “this call and any sub-calls,” and says child runnable configuration is passed through a ContextVar and merged. That is the intended propagation behavior for runnable calls; it does not guarantee that a custom delegation wrapper or separately invoked agent forwards the configuration correctly.

Callback handlers expose distinct events for chain, tool, and language-model failures. Their run metadata includes a run_id and optional parent_run_id, which can help connect a child event to its parent. If you record only the outermost event, a child tool error or model-call error may not be apparent in the log you are inspecting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A reported callback-setup omission

LangChain issue #36395 describes a particular agent model-node path using trace=False, where callback setup was bypassed in the cited RunnableCallable.ainvoke() path and callbacks did not reach LLM calls in that example. The issue reporter characterizes it as a silent failure. This is a report about a specific path, not evidence that all LangChain agents or releases omit callbacks; the available evidence does not establish whether the issue was resolved or how broadly it applies.

Check the installed version and the actual invocation path before treating that report as the explanation for your case. A callback configuration can be correct at the outer call and still fail to reach a child if a custom boundary takes a different path.

Why can a parent agent say the sub-agent succeeded when a child tool failed?

Callback visibility and supervisor visibility are separate. LangChain’s subagent documentation explains that the supervisor calls a subagent as a tool and, by default, “the supervisor only sees the final output.” If a child performs tool calls but leaves their results or errors out of its final message, the supervisor may have no useful evidence of that work when composing its response.

Make the child’s return contract explicit: require it to report whether the task succeeded, relevant tool outcomes, and any failure details the supervisor needs. Where appropriate, pass selected state keys back explicitly through a Command rather than relying on an unstructured summary. This addresses a missing handoff; it does not repair callback propagation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can error handling change what the parent receives?

Yes. The ToolErrorMiddleware reference describes opt-in handling that can turn an exception into a ToolMessage with error status. If an exception is not handled that way, it propagates and can halt the run. Therefore, a child operation may have failed even when the supervisor receives a tool result instead of a thrown exception.

Interrupts and parent commands are control-flow signals, not ordinary tool exceptions; the reference says they propagate separately and do not reach on_error. An absent error callback is not, by itself, proof that an exception was swallowed. First identify whether the event was an ordinary exception, a handled tool error, or control flow.

How to trace a LangChain sub-agent failure

  1. Inspect the child run. Capture its run_id, parent_run_id, event type, and error details. Determine whether it emitted on_tool_error, on_chain_error, or on_llm_error, rather than relying only on the parent’s final event.
  2. Verify configuration at each delegation boundary. Confirm that the child runnable actually receives the intended callback configuration. Standard runnable configuration is designed to propagate, but custom wrappers and separately invoked agents should be checked at their own boundary.
  3. Check the invocation path and version. If callbacks are absent from LLM calls, compare the actual path with the trace=False case described in issue #36395. Do not assume the issue report applies to every version or agent implementation.
  4. Identify the failure semantics. Establish whether an exception propagated, was converted into an error-status tool result, or was an interrupt or parent command. Those cases have different event behavior.
  5. Inspect the child’s final output and state handoff. Check whether the supervisor received the error, useful tool results, and any required state. If not, strengthen the return contract or pass the required state explicitly.
  6. Compare the event tree with the supervisor response. If child error events exist but the response omits them, focus on handoff or synthesis. If child events are missing, investigate configuration and tracing setup. If the error appears as a tool result, inspect the handling policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Which boundary should you fix?

What you observe Boundary to inspect What to verify
No child callback events Configuration propagation or callback setup Whether the child receives the callback configuration and whether its invocation path sets callbacks up.
Child error event exists, but supervisor reports success Result handoff or response synthesis Whether the child returns the error and relevant results in its final message or explicit state.
Tool result arrives with error status Error middleware Whether an exception was intentionally converted into a tool result rather than propagated.
No on_error event for an interrupt or parent command Control-flow handling Whether the event is a control-flow signal rather than an ordinary exception.

These distinctions follow from LangChain’s callback event, error-handling, and subagent handoff contracts. A parent-level success event describes the parent’s run outcome; it is not a guarantee that every child operation succeeded or that every child result reached the supervisor.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.