Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: optional reply times in Settings > Chat (#14500)

Daniel Hanb172be42db0b
diff --git a/studio/frontend/scripts/check-bundle-budget.ts b/studio/frontend/scripts/check-bundle-budget.ts
index 19bf02abd8c..270da542663 100644
--- a/studio/frontend/scripts/check-bundle-budget.ts
+++ b/studio/frontend/scripts/check-bundle-budget.ts
@@ -374,8 +374,11 @@ export const BUDGET = {
// Local addresses in the desktop browser panel (#14290): the grant, per-tab bookkeeping and agent check live in
// the eager browser store, executor and panel: +1,808 B raw / +551 B transfer (6,891,248 -> 6,893,056 B raw,
// 2,076,155 -> 2,076,706 B transfer against c2f75c486, one machine and build). Raised to that plus the same margin.
- transferBytes: 2_076_895,
- rawBytes: 6_893_216,
+ // Opt-in reply times (#14500: the Settings > Chat row, its eager English strings and the reply footer gate):
+ // +1,514 B raw / +418 B transfer over main (6,891,262 -> 6,892,776 B raw, 2,076,131 -> 2,076,549 B transfer
+ // merged at c2f75c4, Node 24, 98 chunks). Raised by that, on top of the above.
+ transferBytes: 2_077_313,
+ rawBytes: 6_894_730,
};
// The chunk count is reported but not budgeted. Splitting a page out of the entry raises it while lowering the
diff --git a/studio/frontend/src/components/assistant-ui/assistant-message-time.tsx b/studio/frontend/src/components/assistant-ui/assistant-message-time.tsx
new file mode 100644
index 00000000000..186fac0ebbe
--- /dev/null
+++ b/studio/frontend/src/components/assistant-ui/assistant-message-time.tsx
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import { useChatPreferencesStore } from "@/features/chat";
+import { useLocale } from "@/i18n";
+import { replyFinishedTimestamp } from "@/lib/message-timestamp";
+import { useAuiState } from "@assistant-ui/react";
+import { type FC, useState } from "react";
+
+/** Opt-in reply time. Gated here so that, while off, a reply mounts no assistant-ui selector:
+ * every mounted one runs on each composer keystroke (composer-keystroke-subscription-budget). */
+export const AssistantMessageTime: FC = () => {
+ const showReplyTimes = useChatPreferencesStore((state) => state.showReplyTimes);
+ return showReplyTimes ? <ReplyTime /> : null;
+};
+
+/** Absolute, not "Today": nothing re-renders an old reply past midnight. A native title, not a
+ * Tooltip: one per reply would subscribe to the modal-layer store. */
+const ReplyTime: FC = () => {
+ const locale = useLocale();
+ const finishedAt = useAuiState(({ message }) => replyFinishedTimestamp(message));
+ const [currentYear] = useState(() => new Date().getFullYear());
+ if (finishedAt === undefined) {
+ return null;
+ }
+ const date = new Date(finishedAt);
+ return (
+ <time
+ dateTime={date.toISOString()}
+ title={date.toLocaleString(locale, { dateStyle: "full", timeStyle: "medium" })}
+ className="aui-assistant-message-time ml-[var(--icon-btn-inset)] mr-2 shrink-0 select-none text-ui-11p5 text-muted-foreground tabular-nums"
+ >
+ {date.toLocaleString(locale, {
+ month: "short",
+ day: "numeric",
+ ...(date.getFullYear() !== currentYear && { year: "numeric" }),
+ hour: "numeric",
+ minute: "2-digit",
+ })}
+ </time>
+ );
+};
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index 9a8c85fb439..d3f30b795db 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -51,6 +51,7 @@ import { PromptQueueList } from "@/components/assistant-ui/lazy-prompt-queue-lis
import { QueueResumeIcon } from "@/components/assistant-ui/queue-resume-icon";
import { ProgressiveMessages } from "@/components/assistant-ui/progressive-messages";
import { MessageMenuTime } from "@/components/assistant-ui/message-menu-time";
+import { AssistantMessageTime } from "@/components/assistant-ui/assistant-message-time";
import { UserMessageActionBar, UserMessageFooter } from "@/components/assistant-ui/user-message-actions";
import { useActionBarFocusReveal } from "@/components/assistant-ui/use-action-bar-focus-reveal";
import {
@@ -8535,6 +8536,8 @@ const AssistantMessage: FC = () => {
</div>
<div className="aui-assistant-message-footer mt-1.5 -ml-[var(--icon-btn-inset)] flex min-h-8 min-w-0 flex-wrap items-center gap-y-1">
+ {/* First, so the action bar mounting on hover never moves it. */}
+ <AssistantMessageTime />
<BranchPicker className="mr-0.5" />
<AssistantActionBar />
</div>
diff --git a/studio/frontend/src/features/chat/stores/chat-preferences-store.ts b/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
index 6f468d28226..b5963ed9364 100644
--- a/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
+++ b/studio/frontend/src/features/chat/stores/chat-preferences-store.ts
@@ -28,7 +28,8 @@ import {
// pastedTextMinChars: paste length that becomes a .txt attachment; 0 is off.
// showInlineEditResponse: on keeps Edit response in each response's action bar instead of its
// More menu. notifyWhenReplyFinishes: on sends a system notification when a reply ends while the
-// window is hidden or unfocused. filesPanelCollapsed: on shrinks Chat with files to a header and
+// window is hidden or unfocused. showReplyTimes: on shows when each reply finished under it.
+// filesPanelCollapsed: on shrinks Chat with files to a header and
// a row of pills.
export interface ChatPreferencesState {
plainTextComposer: boolean;
@@ -47,6 +48,8 @@ export interface ChatPreferencesState {
setShowModelDisclaimer: (value: boolean) => void;
showResponseModel: boolean;
setShowResponseModel: (value: boolean) => void;
+ showReplyTimes: boolean;
+ setShowReplyTimes: (value: boolean) => void;
showInlineEditResponse: boolean;
setShowInlineEditResponse: (value: boolean) => void;
thinkingVisibility: DisplayVisibility;
@@ -97,6 +100,9 @@ export const useChatPreferencesStore = create<ChatPreferencesState>()(
set({ showModelDisclaimer }),
showResponseModel: false,
setShowResponseModel: (showResponseModel) => set({ showResponseModel }),
+ // Off by default: it adds text under every reply, so it stays opt in.
+ showReplyTimes: false,
+ setShowReplyTimes: (showReplyTimes) => set({ showReplyTimes }),
showInlineEditResponse: true,
setShowInlineEditResponse: (showInlineEditResponse) =>
set({ showInlineEditResponse }),
@@ -150,6 +156,7 @@ export const useChatPreferencesStore = create<ChatPreferencesState>()(
alwaysDeleteChatFiles: saved?.alwaysDeleteChatFiles ?? false,
showModelDisclaimer: saved?.showModelDisclaimer ?? false,
showResponseModel: saved?.showResponseModel ?? false,
+ showReplyTimes: saved?.showReplyTimes === true,
showInlineEditResponse: saved?.showInlineEditResponse ?? true,
thinkingVisibility: migrateVisibility(
saved?.thinkingVisibility,
diff --git a/studio/frontend/src/features/settings/settings-search.ts b/studio/frontend/src/features/settings/settings-search.ts
index 3f11c883fa1..6f7e009a729 100644
--- a/studio/frontend/src/features/settings/settings-search.ts
+++ b/studio/frontend/src/features/settings/settings-search.ts
@@ -146,6 +146,7 @@ export const SETTINGS_SEARCH_INDEX: Record<SettingsTab, TranslationKey[]> = {
"settings.chat.webSearch.images",
"settings.chat.modelDisclaimer",
"settings.chat.inlineEditResponse",
+ "settings.chat.showReplyTimes",
"settings.chat.groups.menu.title",
],
browser: [
@@ -469,6 +470,7 @@ export const SETTINGS_SEARCH_KEYWORDS: Partial<
"settings.chat.autoScroll": "settings.chat.autoScrollKeywords",
"settings.chat.scrollToBottomButton": "settings.chat.scrollToBottomButtonKeywords",
"settings.chat.replyNotification": "settings.chat.replyNotificationKeywords",
+ "settings.chat.showReplyTimes": "settings.chat.showReplyTimesKeywords",
// match protocol and agent names omitted from the title.
"settings.apiKeys.mcp.title": "settings.apiKeys.mcp.keywords",
// the intro names only some agents; every listed one has to find this page.
diff --git a/studio/frontend/src/features/settings/tabs/chat-tab.tsx b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
index 8c78b9e30e1..1153c16f0c0 100644
--- a/studio/frontend/src/features/settings/tabs/chat-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
@@ -363,6 +363,12 @@ export function ChatTab() {
const setShowResponseModel = useChatPreferencesStore(
(state) => state.setShowResponseModel,
);
+ const showReplyTimes = useChatPreferencesStore(
+ (state) => state.showReplyTimes,
+ );
+ const setShowReplyTimes = useChatPreferencesStore(
+ (state) => state.setShowReplyTimes,
+ );
const autoScrollWhileGenerating = useChatPreferencesStore(
(state) => state.autoScrollWhileGenerating,
);
@@ -780,6 +786,16 @@ export function ChatTab() {
onCheckedChange={setShowResponseModel}
/>
</SettingsRow>
+ <SettingsRow
+ label={t("settings.chat.showReplyTimes")}
+ description={t("settings.chat.showReplyTimesDescription")}
+ >
+ <Switch
+ aria-label={t("settings.chat.showReplyTimes")}
+ checked={showReplyTimes}
+ onCheckedChange={setShowReplyTimes}
+ />
+ </SettingsRow>
<SettingsRow
label={t("settings.chat.inlineEditResponse")}
description={t("settings.chat.inlineEditResponseDescription")}
diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.ts
index 7007ca5d222..b4ad73c1aac 100644
--- a/studio/frontend/src/i18n/locales/ar.ts
+++ b/studio/frontend/src/i18n/locales/ar.ts
@@ -2710,6 +2710,10 @@ export const ar = {
showResponseModel: "إظهار نموذج الاستجابة",
showResponseModelDescription:
"إظهار البيانات الوصفية للنموذج في ردود المساعد.",
+ showReplyTimes: "أوقات الردود",
+ showReplyTimesDescription: "إظهار وقت انتهاء كل رد أسفله.",
+ showReplyTimesKeywords:
+ "طابع زمني وقت ساعة تاريخ متى انتهى رد رسالة timestamp time clock date reply",
inlineEditResponse: "تعديل الرد في الردود",
inlineEditResponseDescription: "إبقاء تعديل الرد على كل رد بدلًا من قائمة المزيد.",
modelDisclaimer: "إظهار إخلاء مسؤولية النموذج",
diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.ts
index 3c1985e78fb..5701b2cba62 100644
--- a/studio/frontend/src/i18n/locales/de.ts
+++ b/studio/frontend/src/i18n/locales/de.ts
@@ -2751,6 +2751,10 @@ export const de = {
showResponseModel: "Antwortmodell anzeigen",
showResponseModelDescription:
"Modellmetadaten in Antworten des Assistenten anzeigen.",
+ showReplyTimes: "Antwortzeiten",
+ showReplyTimesDescription: "Unter jeder Antwort anzeigen, wann sie fertig war.",
+ showReplyTimesKeywords:
+ "Zeitstempel Uhrzeit Datum wann fertig Antwort Nachricht timestamp time clock date reply",
inlineEditResponse: "Antwort bearbeiten bei Antworten",
inlineEditResponseDescription: "Antwort bearbeiten bei jeder Antwort anzeigen statt im Menü „Mehr“.",
modelDisclaimer: "Modell-Hinweis anzeigen",
diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.ts
index 26d15e14e85..404a50c0fb0 100644
--- a/studio/frontend/src/i18n/locales/en.ts
+++ b/studio/frontend/src/i18n/locales/en.ts
@@ -2768,6 +2768,10 @@ export const en = {
showResponseModel: "Response model",
showResponseModelDescription:
"Show model details in assistant responses.",
+ showReplyTimes: "Reply times",
+ showReplyTimesDescription: "Show when each reply finished, below the reply.",
+ showReplyTimesKeywords:
+ "timestamp time clock date hour when finished arrived reply response message",
inlineEditResponse: "Edit response on responses",
inlineEditResponseDescription:
"Keep Edit response on every response, instead of in the More menu.",
diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.ts
index 2c4f351c7a3..ad1f3de0ea9 100644
--- a/studio/frontend/src/i18n/locales/es.ts
+++ b/studio/frontend/src/i18n/locales/es.ts
@@ -2742,6 +2742,10 @@ export const es = {
showResponseModel: "Mostrar el modelo de respuesta",
showResponseModelDescription:
"Muestra los metadatos del modelo en las respuestas del asistente.",
+ showReplyTimes: "Hora de las respuestas",
+ showReplyTimesDescription: "Mostrar debajo de cada respuesta cuándo terminó.",
+ showReplyTimesKeywords:
+ "marca de tiempo hora fecha cuándo terminó respuesta mensaje timestamp time clock date reply",
inlineEditResponse: "Editar respuesta en las respuestas",
inlineEditResponseDescription: "Mostrar Editar respuesta en cada respuesta, en lugar de en el menú Más.",
modelDisclaimer: "Mostrar aviso del modelo",
diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.ts
index a9b3b544ae3..48fc2ef2dce 100644
--- a/studio/frontend/src/i18n/locales/fr.ts
+++ b/studio/frontend/src/i18n/locales/fr.ts
@@ -2748,6 +2748,10 @@ export const fr = {
showResponseModel: "Afficher le modèle de réponse",
showResponseModelDescription:
"Afficher les métadonnées du modèle dans les réponses de l’assistant.",
+ showReplyTimes: "Heure des réponses",
+ showReplyTimesDescription: "Afficher sous chaque réponse l'heure à laquelle elle s'est terminée.",
+ showReplyTimesKeywords:
+ "horodatage heure date quand terminé réponse message timestamp time clock date reply",
inlineEditResponse: "Modifier la réponse sur les réponses",
inlineEditResponseDescription: "Afficher Modifier la réponse sur chaque réponse, plutôt que dans le menu Plus.",
modelDisclaimer: "Afficher l'avertissement du modèle",
diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.ts
index a21e9e8f256..e639b7a55ca 100644
--- a/studio/frontend/src/i18n/locales/he.ts
+++ b/studio/frontend/src/i18n/locales/he.ts
@@ -2826,6 +2826,10 @@ export const he = {
"notify notification alert done finished reply background minimized התראה הודעה הסתיים מוכן תשובה רקע ממוזער",
showResponseModel: "מודל המענה",
showResponseModelDescription: "הצג פרטי מודל בתשובות העוזר.",
+ showReplyTimes: "זמני תשובות",
+ showReplyTimesDescription: "הצג מתחת לכל תשובה מתי היא הסתיימה.",
+ showReplyTimesKeywords:
+ "חותמת זמן שעה תאריך מתי הסתיים תשובה הודעה timestamp time clock date reply",
inlineEditResponse: "עריכת תגובה על גבי התגובות",
inlineEditResponseDescription:
"הצג את 'עריכת תגובה' בכל תגובה, במקום בתפריט 'עוד'.",
diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.ts
index 872a91b1169..b0c76aa33fd 100644
--- a/studio/frontend/src/i18n/locales/hi.ts
+++ b/studio/frontend/src/i18n/locales/hi.ts
@@ -2719,6 +2719,10 @@ export const hi = {
showResponseModel: "जवाब देने वाला मॉडल दिखाएँ",
showResponseModelDescription:
"असिस्टेंट के जवाबों में मॉडल का मेटाडेटा दिखाएँ।",
+ showReplyTimes: "जवाब का समय",
+ showReplyTimesDescription: "हर जवाब के नीचे दिखाएँ कि वह कब पूरा हुआ।",
+ showReplyTimesKeywords:
+ "टाइमस्टैम्प समय घड़ी तारीख कब पूरा जवाब संदेश timestamp time clock date reply",
inlineEditResponse: "जवाबों पर जवाब संपादित करें",
inlineEditResponseDescription: "जवाब संपादित करें को More मेन्यू के बजाय हर जवाब पर दिखाएँ।",
modelDisclaimer: "मॉडल अस्वीकरण दिखाएं",
diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.ts
index 6dea0c78a16..547f64e030e 100644
--- a/studio/frontend/src/i18n/locales/it.ts
+++ b/studio/frontend/src/i18n/locales/it.ts
@@ -2656,6 +2656,10 @@ export const it = {
showResponseModel: "Mostra il modello della risposta",
showResponseModelDescription:
"Mostra i metadati del modello nelle risposte dell'assistente.",
+ showReplyTimes: "Orario delle risposte",
+ showReplyTimesDescription: "Mostra sotto ogni risposta quando è terminata.",
+ showReplyTimesKeywords:
+ "orario ora data quando terminata risposta messaggio timestamp time clock date reply",
inlineEditResponse: "Modifica risposta nelle risposte",
inlineEditResponseDescription: "Mostra Modifica risposta su ogni risposta, invece che nel menu Altro.",
modelDisclaimer: "Mostra l'avviso sul modello",
diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.ts
index ed564f31053..fdb92d5ae64 100644
--- a/studio/frontend/src/i18n/locales/ja.ts
+++ b/studio/frontend/src/i18n/locales/ja.ts
@@ -2696,6 +2696,10 @@ export const ja = {
showResponseModel: "応答モデルを表示",
showResponseModelDescription:
"アシスタントの応答にモデルのメタデータを表示します。",
+ showReplyTimes: "応答の時刻",
+ showReplyTimesDescription: "各応答の下に、完了した時刻を表示します。",
+ showReplyTimesKeywords:
+ "タイムスタンプ 時刻 時間 日付 完了 応答 メッセージ timestamp time clock date reply",
inlineEditResponse: "応答に応答の編集を表示",
inlineEditResponseDescription: "応答の編集を「その他」メニューではなく、各応答に表示します。",
modelDisclaimer: "モデルの免責事項を表示",
diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.ts
index 32b8d5850a3..c6cadaf59f3 100644
--- a/studio/frontend/src/i18n/locales/ko.ts
+++ b/studio/frontend/src/i18n/locales/ko.ts
@@ -2701,6 +2701,10 @@ export const ko = {
showResponseModel: "응답 모델 표시",
showResponseModelDescription:
"어시스턴트 응답에 모델 메타데이터를 표시합니다.",
+ showReplyTimes: "응답 시간",
+ showReplyTimesDescription: "각 응답 아래에 완료된 시간을 표시합니다.",
+ showReplyTimesKeywords:
+ "타임스탬프 시간 시각 날짜 완료 응답 메시지 timestamp time clock date reply",
inlineEditResponse: "응답에 응답 편집 표시",
inlineEditResponseDescription: "응답 편집을 더보기 메뉴 대신 모든 응답에 표시합니다.",
modelDisclaimer: "모델 고지 표시",
diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.ts
index ab3f4d07a0d..7358f038a92 100644
--- a/studio/frontend/src/i18n/locales/pt-br.ts
+++ b/studio/frontend/src/i18n/locales/pt-br.ts
@@ -2729,6 +2729,10 @@ export const ptBR = {
showResponseModel: "Mostrar o modelo da resposta",
showResponseModelDescription:
"Mostra os metadados do modelo nas respostas do assistente.",
+ showReplyTimes: "Horário das respostas",
+ showReplyTimesDescription: "Mostrar abaixo de cada resposta quando ela terminou.",
+ showReplyTimesKeywords:
+ "carimbo de data hora data quando terminou resposta mensagem timestamp time clock date reply",
inlineEditResponse: "Editar resposta nas respostas",
inlineEditResponseDescription: "Mostrar Editar resposta em cada resposta, em vez de no menu Mais.",
modelDisclaimer: "Mostrar aviso do modelo",
diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.ts
index 494ce54df82..3121c4f6566 100644
--- a/studio/frontend/src/i18n/locales/ru.ts
+++ b/studio/frontend/src/i18n/locales/ru.ts
@@ -2727,6 +2727,10 @@ export const ru = {
showResponseModel: "Показывать модель в ответах",
showResponseModelDescription:
"Показывать метаданные модели в ответах ассистента.",
+ showReplyTimes: "Время ответов",
+ showReplyTimesDescription: "Показывать под каждым ответом, когда он завершился.",
+ showReplyTimesKeywords:
+ "время метка дата когда завершено ответ сообщение timestamp time clock date reply",
inlineEditResponse: "Изменение ответа в ответах",
inlineEditResponseDescription: "Показывать «Изменить ответ» у каждого ответа, а не в меню «Ещё».",
modelDisclaimer: "Показывать предупреждение о модели",
diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.ts
index 10ec7e370a2..a2005da456f 100644
--- a/studio/frontend/src/i18n/locales/sv.ts
+++ b/studio/frontend/src/i18n/locales/sv.ts
@@ -2910,6 +2910,10 @@ export const sv = {
showResponseModel: "Svarsmodell",
showResponseModelDescription:
"Visa modellinformation i assistentens svar.",
+ showReplyTimes: "Svarstider",
+ showReplyTimesDescription: "Visa under varje svar när det blev klart.",
+ showReplyTimesKeywords:
+ "tidsstämpel tid klocka datum när klar svar meddelande timestamp time clock date reply",
inlineEditResponse: "Redigera svar på svaren",
inlineEditResponseDescription:
"Visa Redigera svar på varje svar i stället för i menyn Mer.",
diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.ts
index 77bae870a59..3b6fce3892a 100644
--- a/studio/frontend/src/i18n/locales/zh-CN.ts
+++ b/studio/frontend/src/i18n/locales/zh-CN.ts
@@ -2667,6 +2667,10 @@ export const zhCN = {
"通知 提醒 完成 结束 就绪 回复 后台 最小化 notify notification alert done finished reply background",
showResponseModel: "显示回复模型",
showResponseModelDescription: "在助手回复中显示模型元数据。",
+ showReplyTimes: "回复时间",
+ showReplyTimesDescription: "在每条回复下方显示其完成的时间。",
+ showReplyTimesKeywords:
+ "时间戳 时间 时刻 日期 完成 回复 消息 timestamp time clock date reply",
inlineEditResponse: "在回复上显示编辑回复",
inlineEditResponseDescription: "在每条回复上显示编辑回复,而不是放在“更多”菜单中。",
modelDisclaimer: "显示模型免责声明",
diff --git a/studio/frontend/src/lib/message-timestamp.ts b/studio/frontend/src/lib/message-timestamp.ts
index 2f4ca1860cb..76aa20d116d 100644
--- a/studio/frontend/src/lib/message-timestamp.ts
+++ b/studio/frontend/src/lib/message-timestamp.ts
@@ -10,3 +10,37 @@ export function messageTimestamp(message: {
const time = message.createdAt?.getTime();
return time !== undefined && Number.isFinite(time) ? time : undefined;
}
+
+/** When a reply finished, else when it was created; none while it is running or awaiting tool approval. */
+export function replyFinishedTimestamp(message: {
+ createdAt?: Date;
+ status?: { type?: string };
+ metadata?: { custom?: Record<string, unknown> };
+}): number | undefined {
+ const status = message.status?.type;
+ if (status === "running" || status === "requires-action") return undefined;
+ const custom = message.metadata?.custom;
+ // Deep Research replies record only their run; completedAt stays null until it ends.
+ const research = custom?.researchRun as { completedAt?: unknown } | undefined;
+ if (research && typeof research === "object") {
+ return typeof research.completedAt === "number" && Number.isFinite(research.completedAt)
+ ? research.completedAt
+ : undefined;
+ }
+ const details = custom?.responseDetails as { finishedAt?: unknown } | undefined;
+ const finishedAt =
+ typeof details?.finishedAt === "number" && Number.isFinite(details.finishedAt)
+ ? details.finishedAt
+ : undefined;
+ const timing = custom?.timing as
+ | { streamStartTime?: unknown; totalStreamTime?: unknown }
+ | undefined;
+ const timingEnd =
+ typeof timing?.streamStartTime === "number" && typeof timing.totalStreamTime === "number"
+ ? timing.streamStartTime + timing.totalStreamTime
+ : undefined;
+ const streamEnd = timingEnd !== undefined && Number.isFinite(timingEnd) ? timingEnd : undefined;
+ // A stopped or failed reply's timing is its last round; responseDetails may be an earlier tool round's.
+ const end = status === "incomplete" ? (streamEnd ?? finishedAt) : (finishedAt ?? streamEnd);
+ return end ?? messageTimestamp(message);
+}
diff --git a/studio/frontend/tests/reply-times-preference.test.ts b/studio/frontend/tests/reply-times-preference.test.ts
new file mode 100644
index 00000000000..9b857083edd
--- /dev/null
+++ b/studio/frontend/tests/reply-times-preference.test.ts
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc, registerBundlerResolver } from "./helpers/kit.ts";
+import { replyFinishedTimestamp } from "../src/lib/message-timestamp.ts";
+
+registerBundlerResolver();
+const { useChatPreferencesStore } = await import(
+ "../src/features/chat/stores/chat-preferences-store.ts"
+);
+
+const STORE = readSrc("features/chat/stores/chat-preferences-store.ts");
+const THREAD = readSrc("components/assistant-ui/thread.tsx");
+const TIME = readSrc("components/assistant-ui/assistant-message-time.tsx");
+const CHAT_TAB = readSrc("features/settings/tabs/chat-tab.tsx");
+
+test("reply times are off for fresh and older saved preferences", () => {
+ assert.equal(useChatPreferencesStore.getInitialState().showReplyTimes, false);
+ assert.match(STORE, /showReplyTimes: saved\?\.showReplyTimes === true/);
+});
+
+test("Settings > Chat toggles the preference", () => {
+ assert.match(CHAT_TAB, /t\("settings\.chat\.showReplyTimes"\)/);
+ assert.match(CHAT_TAB, /onCheckedChange=\{setShowReplyTimes\}/);
+});
+
+test("the time leads the reply footer, outside the autohiding action bar", () => {
+ const footer = THREAD.indexOf("aui-assistant-message-footer");
+ assert.notEqual(footer, -1);
+ const time = THREAD.indexOf("<AssistantMessageTime />", footer);
+ const bar = THREAD.indexOf("<AssistantActionBar />", footer);
+ assert.ok(time !== -1 && time < bar);
+ const gate = TIME.slice(
+ TIME.indexOf("export const AssistantMessageTime"),
+ TIME.indexOf("const ReplyTime"),
+ );
+ assert.match(gate, /return showReplyTimes \? <ReplyTime \/> : null;/);
+ assert.doesNotMatch(gate, /useAuiState/);
+ assert.doesNotMatch(TIME, /setInterval|setTimeout|useEffect|components\/ui\/tooltip/);
+ assert.doesNotMatch(TIME, /formatMessageDate|todayAt|yesterdayAt/);
+});
+
+test("prefers the finish time, falls back to creation, hides while running", () => {
+ const createdAt = new Date("2026-10-13T23:00:00Z");
+ const finishedAt = Date.parse("2026-10-13T23:55:01Z");
+ const done = {
+ createdAt,
+ status: { type: "complete" },
+ metadata: { custom: { responseDetails: { finishedAt } } },
+ };
+ assert.equal(replyFinishedTimestamp(done), finishedAt);
+ assert.equal(
+ replyFinishedTimestamp({ createdAt, status: { type: "complete" } }),
+ createdAt.getTime(),
+ );
+ assert.equal(
+ replyFinishedTimestamp({ ...done, status: { type: "running" } }),
+ undefined,
+ );
+ // A stopped reply records no responseDetails, only how long it streamed.
+ const stoppedAt = Date.parse("2026-10-14T04:12:00Z");
+ assert.equal(
+ replyFinishedTimestamp({
+ createdAt,
+ status: { type: "incomplete" },
+ metadata: {
+ custom: {
+ timing: {
+ streamStartTime: createdAt.getTime(),
+ totalStreamTime: stoppedAt - createdAt.getTime(),
+ },
+ },
+ },
+ }),
+ stoppedAt,
+ );
+ assert.equal(
+ replyFinishedTimestamp({ ...done, status: { type: "requires-action" } }),
+ undefined,
+ );
+ // A later tool round that failed keeps the earlier round's responseDetails.
+ const failedAt = Date.parse("2026-10-14T05:00:00Z");
+ assert.equal(
+ replyFinishedTimestamp({
+ createdAt,
+ status: { type: "incomplete" },
+ metadata: {
+ custom: {
+ responseDetails: { finishedAt },
+ timing: { streamStartTime: failedAt - 60_000, totalStreamTime: 60_000 },
+ },
+ },
+ }),
+ failedAt,
+ );
+ const researchDone = Date.parse("2026-10-14T07:30:00Z");
+ const research = (completedAt: number | null) => ({
+ createdAt,
+ status: { type: "complete" },
+ metadata: { custom: { researchRun: { status: "completed", completedAt } } },
+ });
+ assert.equal(replyFinishedTimestamp(research(researchDone)), researchDone);
+ // A run still going after a reload is restored as a complete message.
+ assert.equal(replyFinishedTimestamp(research(null)), undefined);
+ assert.equal(
+ replyFinishedTimestamp({
+ createdAt,
+ metadata: {
+ custom: {
+ createdAtEstimated: true,
+ responseDetails: { finishedAt: Number.NaN },
+ },
+ },
+ }),
+ undefined,
+ );
+});