Skip to content

fix(platform): keep tool time out of the message info model phases - #4923

Merged
yannickmonney merged 3 commits into
mainfrom
fix/chat-message-info-tool-time
Oct 13, 2026
Merged

yannickmonney merged 3 commits into
mainfrom
fix/chat-message-info-tool-time

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

Problem

A reply that called a tool before it answered showed the tool's running time as model time in the message info dialog: the phase bar labelled everything up to the answer "Waiting for the model" (or "Thinking" after a reasoning round), and the output-speed window included the tools too. The dialog's memo equality also skipped fields it renders (the endpoint's host and region, and the two phase-bar inputs setupMs and timeToFirstReasoningMs), so it could stay stale.

Change

  • replyPhases(usage, parts) and outputTokensPerSecond(usage, parts) read the reply's parts. A reply that ran tools shows Preparing, then a new Model and tools phase (messageInfo.phases.tools, en/de/fr), then Writing only when the answer's first text came after the last tool. Such a reply shows no output speed: its token count spans every round.
  • sameServing compares host and region; sameUsage also compares setupMs and timeToFirstReasoningMs.
  • docs/{en,de,fr}/platform/chat/basics.md and manual box CHAT-F13 state the new behaviour.

Follow-up to #4493. Supersedes #4498: that PR was closed on 2026-10-07 after an independent review accepted it (findings 1 and 2 closed) while its CI was red on a hosted-runner apt timeout, and GitHub cannot reopen it now that its head is rebased. Same two commits, rebased onto current main, plus a comment-only cleanup of two test comments.

Verification

  • Red, then green: with main's old message-timing, message-equality and message-info-dialog sources swapped in, 8 of the 37 tests in the three touched test files fail; with the change all 37 pass.
  • All of app/features/chat under the UI config: 49 files, 643 tests. lib/i18n (server project): 11 files, 618 tests. services/docs: 37 files, 708 tests.
  • tsc --noEmit, oxlint --type-aware, oxfmt --check, lint:conflicts, lint:manual, lint:links: clean.
  • Not run: a real-browser render of the dialog (320 px, dark), manual boxes CHAT-F13 and CHAT-F62, e2e.

Follow-ups (not in this PR)

  • A server-side stamp per round would let the bar draw the tool span as its own phase and show the answer round's own output speed. That is the review's preferred fix; this PR is its stated minimum.
  • Whether the bare "Provider" label in French takes Fournisseur or Fournisseur IA is a glossary decision, left to a glossary owner.

yannickmonney and others added 3 commits October 13, 2026 12:11
Refs #4493. Closes the findings of the post-merge review
#4493 (review)

The timing anchors are turn-wide: the first round that wrote text sets
the first-token stamp, so a reply that called a tool first drew the
whole span up to its answer, the tool's run included, as "Waiting for
the model" (or "Thinking" after a reasoning round), and the output
speed window held the tools too.

- A reply whose parts hold a tool call or result now draws one "Model
  and tools" phase after preparing, then writing only when the answer's
  first text came after the last tool, and shows no output speed: its
  output count sums every round and no anchor bounds the answer round.
- Docs (en/de/fr): the time to first token is the time to the answer's
  first words, and it includes tool time on a reply that used tools.
- sameServing compares the endpoint's host and region, as sameServedBy
  does, and sameUsage the setup and first-reasoning anchors the phase
  bar draws.
Refs #4493. Repairs the independent review of #4498 at 938a6c4
(#4498 (comment)).
Code unchanged.

- docs/{en,de,fr}/platform/chat/basics.md: the time to first token
  includes the time of any tool that ran before the first words, and the
  bar shows writing only when the first words came after the last tool.
  A lead-in before a tool call puts no tool time in the first-token time
  and leaves no writing phase.
- CHAT-F13: on a reply that ran a tool, Output speed is absent and the
  legend shows Model and tools with no waiting or thinking phase.
@yannickmonney
yannickmonney merged commit 422299d into main Oct 13, 2026
64 checks passed
@yannickmonney
yannickmonney deleted the fix/chat-message-info-tool-time branch October 13, 2026 12:18
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