Skip to content

The agent that grows with you

fix(desktop): say a sub-second reasoning block was brief

Brooklyn Nicholson6ba2f3e6444d
diff --git a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
index c3ddb255c7f..93a4f24a6eb 100644
--- a/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
+++ b/apps/desktop/src/components/assistant-ui/thread/message-parts.tsx
@@ -89,6 +89,15 @@ const ThinkingDisclosure: FC<{
}
}, [elapsed, pending, watching])
+ // The timer counts whole seconds, so a block that finished inside one reports
+ // "0s" — accurate and useless. Say it was quick and leave the number out.
+ const thoughtLabel =
+ pending || thoughtFor === null
+ ? t.assistant.thread.thinking
+ : thoughtFor < 1
+ ? t.assistant.thread.thoughtBriefly
+ : t.assistant.thread.thoughtFor(formatElapsed(thoughtFor))
+
// While the preview is live, pin the scroll container to the bottom on
// every content growth so the latest tokens are always visible.
useEffect(() => {
@@ -143,9 +152,7 @@ const ThinkingDisclosure: FC<{
pending && 'shimmer text-foreground/55'
)}
>
- {pending || thoughtFor === null
- ? t.assistant.thread.thinking
- : t.assistant.thread.thoughtFor(formatElapsed(thoughtFor))}
+ {thoughtLabel}
</span>
{pending && (
<ActivityTimerText
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index ee1fe3b2079..6557fcc87be 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -2273,6 +2273,7 @@ export const ar = defineLocale({
resumeWhenBackgroundDone: count =>
count === 1 ? 'سيُستأنف عند انتهاء المهمة الخلفية' : `سيُستأنف عند انتهاء ${count} مهام خلفية`,
thinking: 'يفكر...',
+ thoughtBriefly: 'فكّر قليلاً',
thoughtFor: duration => `فكّر لمدة ${duration}`,
today: time => `اليوم ${time}`,
yesterday: time => `أمس ${time}`,
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index f68b2657bc8..4f5b8fe1048 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -2668,6 +2668,7 @@ export const en: Translations = {
? 'Will resume when the background task finishes'
: `Will resume when ${count} background tasks finish`,
thinking: 'Thinking',
+ thoughtBriefly: 'Thought briefly',
thoughtFor: duration => `Thought for ${duration}`,
today: time => `Today, ${time}`,
yesterday: time => `Yesterday, ${time}`,
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index ab01313842d..ec428cc7638 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -2517,6 +2517,7 @@ export const ja = defineLocale({
? 'バックグラウンドタスクの完了後に再開します'
: `${count} 件のバックグラウンドタスクの完了後に再開します`,
thinking: '考え中',
+ thoughtBriefly: '少し思考',
thoughtFor: duration => `${duration} 思考`,
today: time => `今日 ${time}`,
yesterday: time => `昨日 ${time}`,
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index f566b17f8cf..ae676578905 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -2267,6 +2267,7 @@ export interface Translations {
loadingResponse: string
resumeWhenBackgroundDone: (count: number) => string
thinking: string
+ thoughtBriefly: string
thoughtFor: (duration: string) => string
today: (time: string) => string
yesterday: (time: string) => string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index e133f4ff3e7..cfcda590134 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -2438,6 +2438,7 @@ export const zhHant = defineLocale({
resumeWhenBackgroundDone: count =>
count === 1 ? '背景工作完成後將自動繼續' : `${count} 個背景工作完成後將自動繼續`,
thinking: '思考中',
+ thoughtBriefly: '思考了片刻',
thoughtFor: duration => `思考了 ${duration}`,
today: time => `今天,${time}`,
yesterday: time => `昨天,${time}`,
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index eebbba53eb8..586b8cedafa 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -2839,6 +2839,7 @@ export const zh: Translations = {
resumeWhenBackgroundDone: count =>
count === 1 ? '后台任务完成后将自动继续' : `${count} 个后台任务完成后将自动继续`,
thinking: '思考中',
+ thoughtBriefly: '思考了片刻',
thoughtFor: duration => `思考了 ${duration}`,
today: time => `今天,${time}`,
yesterday: time => `昨天,${time}`,