From 0df7d120737d3f6e48fe7d8d73389998a3c11745 Mon Sep 17 00:00:00 2001 From: Yashas Date: Wed, 9 Sep 2026 17:17:25 +0530 Subject: [PATCH] console: stop printing the customer's words under the AI's name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A contiguous run of WhatsApp turns collapsed into one timeline entry that kept the FIRST turn's speaker and previewed the LAST turn's message. When a run held the customer's question and Engage's answer, the entry carried Engage's chip over a quote the customer had typed — the trail claimed the machine said something a person did, which on an accountability demo is the worst thing it could get wrong. Runs now group per speaker. That still collapses the case grouping exists for (the same sentence resent several times) and can no longer misattribute, because every row in a run is one voice. Customer runs read "the customer / THE CUSTOMER SAID"; Engage runs read as Engage / WE REPLIED. Co-Authored-By: Claude Opus 5 (1M context) --- src/components/Timeline.jsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Timeline.jsx b/src/components/Timeline.jsx index 6b3ef90..1236fef 100644 --- a/src/components/Timeline.jsx +++ b/src/components/Timeline.jsx @@ -346,7 +346,14 @@ export default function Timeline({ rows, onOpenAgent, onOpenChat, onOpenCall }) const grouped = [] for (const it of items) { const last = grouped[grouped.length - 1] - if (it.isChat && last && last.isChat) { + // SAME SPEAKER ONLY. Collapsing every contiguous chat turn folded the + // customer's question and the AI's answer into one entry that kept the + // FIRST turn's name and the LAST turn's words — so the customer's message + // printed under Engage's chip, attributing to the machine something a + // person had typed. Grouping per speaker still collapses the case this + // exists for (the same sentence resent four times) and can never + // misattribute, because every row in a run is the same voice. + if (it.isChat && last && last.isChat && last.agentKey === it.agentKey) { last.count += 1 last.when = it.when // Keep the newest line as the preview — an operator scanning the trail