From 03f300d46bbb2262a31ba43790ec3326f6a62e52 Mon Sep 17 00:00:00 2001 From: mo Date: Sun, 28 Jun 2026 12:01:06 +0000 Subject: [PATCH] Knowledge Chat: surface LangSmith trace link when tracing enabled (reads /rag/config) --- .../components/features/KnowledgeChatView.tsx | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ui/src/components/features/KnowledgeChatView.tsx b/ui/src/components/features/KnowledgeChatView.tsx index 18a0d86..04e08aa 100644 --- a/ui/src/components/features/KnowledgeChatView.tsx +++ b/ui/src/components/features/KnowledgeChatView.tsx @@ -40,6 +40,7 @@ export function KnowledgeChatView({ onGpuActivity }: Props = {}) { const [catalogDocs, setCatalogDocs] = useState(null) const [showArch, setShowArch] = useState(true) const [activeStage, setActiveStage] = useState(null) + const [traceCfg, setTraceCfg] = useState<{ tracing: boolean; project: string; smith_url: string } | null>(null) const bottomRef = useRef(null) const loadMeta = useCallback(async () => { @@ -77,6 +78,13 @@ export function KnowledgeChatView({ onGpuActivity }: Props = {}) { loadCatalog() }, [loadMeta, loadCatalog]) + useEffect(() => { + fetch('/rag/config') + .then((r) => (r.ok ? r.json() : null)) + .then((c) => { if (c) setTraceCfg(c) }) + .catch(() => {}) + }, []) + useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: 'smooth' }) }, [messages, loading]) @@ -351,6 +359,17 @@ export function KnowledgeChatView({ onGpuActivity }: Props = {}) { )} + {traceCfg?.tracing && ( + + LangSmith ↗ + + )}