Skip to content

feat(desktop): show per-turn wall-clock duration in the transcript - #84430

Closed
Tommy00748 wants to merge 1 commit into
NousResearch:mainfrom
Tommy00748:feat/desktop-turn-duration
Closed

feat(desktop): show per-turn wall-clock duration in the transcript#84430
Tommy00748 wants to merge 1 commit into
NousResearch:mainfrom
Tommy00748:feat/desktop-turn-duration

Conversation

@Tommy00748

@Tommy00748 Tommy00748 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Each assistant reply in the desktop app now carries a small time badge (⏱ 38s) below the message text, showing how long its turn took (message.start → message.complete). Users get a glanceable sense of task latency per turn — useful when a turn spins through many tools or a long reasoning block.

Design notes

  • Renderer-side timing. The desktop already tracks turnStartedAt per session (set on message.start, cleared on completion). The badge duration is computed from that at settle time — no backend change, no new events, works for adopted and local turns alike.
  • Stamped on ChatMessage.durationS at completion in completeAssistantMessage (all settle paths via completeMessage/newAssistantFromCompletion) and on failAssistantMessage (failed turns get a badge too).
  • Not persisted. History hydrated from the backend has no badge, matching how reasoning-block durations already behave (useMeasuredDuration is renderer-memory only). The badge is a "you were here" signal, not archival data.
  • Perf-safe. The useAuiState selector for the badge reads a value set once at completion — referentially stable across the 30 Hz delta stream, so no per-token re-renders (the component has strict perf rules; the footer/action bar must not subscribe to streaming text).
  • i18n: new assistant.thread.turnDuration key added to all five locale files.

Verification

  • npm run typecheck (renderer + electron + e2e tsconfigs) ✅
  • eslint clean on all changed files ✅
  • npm run test:ui — 413 files / 3680 tests ✅
  • vitest run --project electron — 86 files / 1023 tests ✅
  • npm run test:desktop:all (packaging + bundle validation) ✅

Each assistant reply now carries a small time badge below the message text
showing how long its turn took (message.start -> message.complete), so
users can gauge task latency at a glance without hovering.

The duration is computed renderer-side from the per-session turnStartedAt
timestamp the app already tracks and stamped onto the ChatMessage at
completion (successful and failed turns alike). It is not persisted
backend-side, so messages hydrated from history have no badge — matching
how reasoning-block durations already behave.

Also adds the assistant.thread.turnDuration i18n key across all five
locale files.
@alt-glitch alt-glitch added type/feature New feature or request comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have labels Aug 12, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #81949 is an earlier open implementation of Desktop turn-duration display that persists end-to-end metadata. This PR instead keeps renderer-only wall-clock duration for live turns. The user-facing scope overlaps, but the persistence/design choices differ; maintainer selection is needed.

@teknium1

Copy link
Copy Markdown
Contributor

Salvaged and merged in #87245 — your commit landed on main with authorship preserved (a6f7a5b → rebase-merged). Two small adjustments during the salvage: kept main's newer timeline fields (completedAt/completeOpenTimelineParts) alongside durationS in the settle paths, and dropped the MessageAge footer component since main had grown MessageTimelineTimestamp in the meantime. The badge itself, the settle-time stamping, the re-render contract entry, and all five locale strings shipped as you wrote them. Nice perf-conscious design — thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants