From a9a0a9cecb5b2d6801059dfb613c386eee1d1563 Mon Sep 17 00:00:00 2001 From: Eddie A Tejeda <669988+eddietejeda@users.noreply.github.com> Date: Sat, 17 Oct 2026 08:11:49 -0700 Subject: [PATCH] Insights: read AIMessage.text as the property it is The unpacker's callable() fallback for older LangChain walked into the str subclass the property now returns, which answers a call with a deprecation warning on every run. Read the property; fall back to content. --- server/insights.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/insights.py b/server/insights.py index 3d51e76..d3671b7 100644 --- a/server/insights.py +++ b/server/insights.py @@ -545,9 +545,12 @@ def _unpack(messages): "rows": None, "error": None} steps.append(step) by_id[call.get("id")] = step - text = getattr(m, "text", "") - if callable(text): - text = text() + # AIMessage.text is a property; it returns a str subclass that + # still answers a call for old code, with a deprecation warning, + # so a callable() check here would walk straight into that + text = getattr(m, "text", None) + if not isinstance(text, str): + text = m.content if isinstance(m.content, str) else "" if text and text.strip(): answer = text.strip() elif mtype == "tool":