[ENHANCEMENT]Update Instrumentation LC React
Issue:
- When using create_react_agent from LangChain with Arize Phoenix tracing, the final AI message (agent's answer) is missing from the Phoenix trace data.
Root Cause:
- Instrumentation Gap: Arize Phoenix (via OpenInference) doesn’t currently capture the final AgentFinish event from LangChain as a distinct span.
- Callback Missing: The on_agent_finish method in the Arize callback isn’t implemented, so the final AI response is not logged.
- New API Limitation: create_react_agent is a newer interface, and its tracing support is not fully mature in Phoenix/OpenInference yet.
- Confirmed by Sean’s Output: The span data pulled via px.Client().query_spans() includes:
- A HumanMessage (user question)
- An AIMessage (tool call)
- A ToolMessage (tool response) ❌ But no span for the final assistant answer.
thanks! just to give you some more context here’s what I got from pulling the spans via px.Client().query_spans it doesn’t have the last AIMessage as a span that’s available in the response.
thanks! just to give you some more context here’s what I got from pulling the spans via px.Client().query_spans it doesn’t have the last AIMessage as a span that’s available in the response.
Let's add this to triage - @caroger
I haven't hered from @arizedatngo or @sean_lee in slack. I am closing this ticket for now. feel free to reopen this ticket if required any workaround.