Skip to content

Show how long the model thought before each reply - #41

Merged
TechNomadCode merged 1 commit into
mainfrom
feat/thinking-line
Oct 21, 2026
Merged

TechNomadCode merged 1 commit into
mainfrom
feat/thinking-line

Conversation

@TechNomadCode

Copy link
Copy Markdown
Owner

Slice 20: the visitor sees when the model is thinking and for how long, never what it thinks.

  • While an answer is on its way and no step runs and no reply arrives, the moving line reads "Thinking" (opencode's row, 13px medium on a 16px line) instead of "Working…".
  • Each reply follows a line "Thought 8s" ("1m 5s" from a minute on), the word in white, the time in grey. It doesn't open: the reasoning's words still never reach the browser.
  • The browser times each wait itself: the chat's transport pipes each answer's stream through timeThoughts, from the request or from the moment the last step running finished, to the next reply's first text or step. It adds a data-thought part to the answer at that place, so it's kept with the conversation and outlasts a reload. Answers kept before this have none and show none, so STORED_FORMAT stays 2.
  • Searches in a row fold together with the thought lines around them, as opencode's groupContent does. The count still counts only the searches.
  • An answer stopped before it finished anything is still left out of what goes back, even with a thought's time in it.

src/server: no files changed. src/lib: no files changed. The times go back to the server inside the answers. safeValidateUIMessages accepts them, and convertToModelMessages leaves them out (ai 7.0.143). A unit test runs the fake model on a conversation with and without the times and shows the model's input is identical.

Checks (local, fakes): verify passed (488 unit tests). test:e2e passed all 67 in the second full run; the first failed 6 waiting on the fake model's answer (KI-7, noted). Page checked at 1440px and 375px on a dev server with the fakes.

Unverified: the real model's waits and times on staging; Safari and Firefox.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechNomadCode TechNomadCode changed the title Show how long the model thought before each reply, as opencode does Show how long the model thought before each reply Oct 21, 2026
@TechNomadCode
TechNomadCode merged commit 9ec158c into main Oct 21, 2026
5 checks passed
@TechNomadCode
TechNomadCode deleted the feat/thinking-line branch October 21, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant