Skip to content

feat(chat): show how long a turn takes - #487

Merged
edenreich merged 1 commit into
mainfrom
feat/turn-elapsed
Nov 9, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/turn-elapsed

Conversation

@edenreich

@edenreich edenreich commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A turn now shows how long it has been running and how long it took. A live counter sits next to the status text in the transcript bubble (for example Starting ubuntu-desktop (...)... 42s), and the status bar gains a time stat that ticks during the turn and keeps the final duration until the next turn starts.

Changes

  • frontend/lib/transcript.ts - ChatState tracks turnStartedAt and lastTurnMs. A turn starts on userSend or RunStarted and ends on Done or Cancelled. The reducer takes now as an argument so it stays pure.
  • frontend/lib/elapsed.ts - formatElapsed (8s, 1m 12s, 1h 03m).
  • frontend/hooks/useNow.ts - one-second ticking clock for the two displays.
  • frontend/store.tsx - passes the clock into the reducer and exposes the active chat's turn timing.
  • frontend/components/Transcript.tsx, frontend/components/StatusBar.tsx - render the elapsed time in its own element. The status label is unchanged.
  • Unit tests for the turn timing and the formatter.

Timing is wall time and includes time spent waiting on an approval. A follow-up sent mid-run does not restart it. Durations are not persisted across a conversation reload, the same as token usage.

No backend change. Affected repos: desktop only. Docs follow-up: inference-gateway/docs#1159.

@edenreich
edenreich marked this pull request as ready for review November 9, 2026 22:52
@edenreich
edenreich merged commit 8da05d8 into main Nov 9, 2026
1 check passed
@edenreich
edenreich deleted the feat/turn-elapsed branch November 9, 2026 22:52
@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.63.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant