From 65dca3a0ecc4dd2632dbc3f7968de7b5b4191b90 Mon Sep 17 00:00:00 2001 From: "mars.yu" Date: Fri, 13 Nov 2026 13:08:13 +0800 Subject: [PATCH] feat(conversation): tag the lines a phone relay said on its own A Twilio ConversationRelay call now keeps the lines the relay says by itself (fillers, idle prompts, the idle goodbye, the apology of a failed turn, a line said again after a cut-in) in the history, labeled in message_label. They show under the agent's name, so a line said again looked like a duplicate reply and an idle prompt like the agent's own. The conversation page now tags each with what it was (Filler, Idle prompt, Idle goodbye, Apology, Said again), with a tooltip saying it was said by the relay and kept as a record of what the caller heard. Other labels are left alone. Co-Authored-By: Claude Opus 5.5 --- src/lib/langs/en.json | 8 +++++++- src/lib/langs/zh.json | 8 +++++++- .../[conversationId]/conv-dialogs.svelte | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/lib/langs/en.json b/src/lib/langs/en.json index 3d71ee90..1fb3218f 100644 --- a/src/lib/langs/en.json +++ b/src/lib/langs/en.json @@ -711,5 +711,11 @@ "Move earlier": "Move earlier", "Move later": "Move later", "Remove agent from the chain": "Remove agent from the chain", - "No tools found for the agents on this case. Add the agent under Involved agents, or type the name.": "No tools found for the agents on this case. Add the agent under Involved agents, or type the name." + "No tools found for the agents on this case. Add the agent under Involved agents, or type the name.": "No tools found for the agents on this case. Add the agent under Involved agents, or type the name.", + "Filler": "Filler", + "Idle prompt": "Idle prompt", + "Idle goodbye": "Idle goodbye", + "Apology": "Apology", + "Said again": "Said again", + "Said by the phone relay on its own, kept as a record of what the caller heard": "Said by the phone relay on its own, kept as a record of what the caller heard" } diff --git a/src/lib/langs/zh.json b/src/lib/langs/zh.json index 9c95e04f..d7fb2817 100644 --- a/src/lib/langs/zh.json +++ b/src/lib/langs/zh.json @@ -905,5 +905,11 @@ "Move earlier": "前移", "Move later": "后移", "Remove agent from the chain": "从调用链里移除", - "No tools found for the agents on this case. Add the agent under Involved agents, or type the name.": "这条用例涉及的 Agent 没有查到可用工具。可以在\"涉及的 Agent\"里补上对应 Agent,或者手动输入工具名。" + "No tools found for the agents on this case. Add the agent under Involved agents, or type the name.": "这条用例涉及的 Agent 没有查到可用工具。可以在\"涉及的 Agent\"里补上对应 Agent,或者手动输入工具名。", + "Filler": "等待语", + "Idle prompt": "空闲提示", + "Idle goodbye": "挂断告别", + "Apology": "道歉", + "Said again": "重说", + "Said by the phone relay on its own, kept as a record of what the caller heard": "电话中继自己说的话,仅记录来电者听到了什么" } diff --git a/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte b/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte index 3aaa9915..30c323cb 100644 --- a/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte +++ b/src/routes/page/conversation/[conversationId]/conv-dialogs.svelte @@ -15,6 +15,17 @@ const maxTextLength = 4096; const duration = 1500; + // Lines a phone relay said on its own, kept only as a record of what the caller heard (the Twilio plugin's + // ConversationRelayLabels). They show under the agent's name, so each is tagged with what it was. + /** @type {Record} */ + const relayLineTags = { + twilio_relay_filler: 'Filler', + twilio_relay_idle_prompt: 'Idle prompt', + twilio_relay_idle_goodbye: 'Idle goodbye', + twilio_relay_apology: 'Apology', + twilio_relay_said_again: 'Said again' + }; + /** * @type {{ * conversation: import('$conversationTypes').ConversationModel, @@ -151,6 +162,14 @@
{dialog.sender?.full_name || dialog.sender?.user_name || 'Unknown'} {utcToLocal(dialog.created_at)} + {#if dialog.message_label && relayLineTags[dialog.message_label]} + + {$_(relayLineTags[dialog.message_label])} + + {/if}