fix: name each tool once, and stream the reasoning live #18

Merged
adrianbonpin merged 1 commits from fix/tool-line-and-live-reasoning into prod 2026-10-06 14:18:51 +00:00
Owner

Three fixes to the transcript, all from the same screenshot.

The tool line listed every call

_Tools: web_search, web_search, web_search, web_fetch (failed), ..._ ran to three lines of the same two words on a research turn. Each tool is now named once, in the order it was first used, with failures counted rather than repeated:

_Tools: web_search, web_fetch (4 failed)_

A refused repeat reads (stopped: the same call kept repeating) instead of being tagged onto one of the names.

Show Tool Calls off still showed the line

The old rule kept the entire list on screen whenever any call failed or was refused as a repeat, which is what made the setting look broken. The names are now hidden like the setting says, and a failure is still mentioned in one sentence, without naming anything:

_2 tool calls failed._
_a call kept repeating, so the turn was cut short._

Reasoning now streams live, and clears per tool call

The reasoning shows while a turn is in flight whatever Show Reasoning says: a model that is thinking rather than writing has nothing else on screen, so hiding it leaves a spinner with no way to tell thinking from hanging. The preference now governs only where the trace settles when the turn ends: kept as an appendix under the answer when on, gone when off.

The live view is only the segment since the last tool call. useChat keeps the whole trace for storage and clears the visible segment each time a tool starts, so:

Reasoning (round 1)  ->  tool runs (reasoning clears)  ->  Reasoning (round 2)  ->  answer

Otherwise a research turn that thinks before each of a dozen calls stacks every round's reasoning on screen at once, and the tool it just asked for runs underneath a wall of text that is no longer about anything.

Notes

  • New src/lib/thinking.ts holds the full/current split as pure functions, so the reset is tested without mounting the hook.
  • npm test (513 passed), npm run typecheck, npm run lint:code, and npx vici build all pass.
Three fixes to the transcript, all from the same screenshot. ## The tool line listed every call `_Tools: web_search, web_search, web_search, web_fetch (failed), ..._` ran to three lines of the same two words on a research turn. Each tool is now named once, in the order it was first used, with failures counted rather than repeated: ``` _Tools: web_search, web_fetch (4 failed)_ ``` A refused repeat reads `(stopped: the same call kept repeating)` instead of being tagged onto one of the names. ## `Show Tool Calls` off still showed the line The old rule kept the entire list on screen whenever any call failed or was refused as a repeat, which is what made the setting look broken. The names are now hidden like the setting says, and a failure is still mentioned in one sentence, without naming anything: ``` _2 tool calls failed._ _a call kept repeating, so the turn was cut short._ ``` ## Reasoning now streams live, and clears per tool call The reasoning shows while a turn is in flight whatever `Show Reasoning` says: a model that is thinking rather than writing has nothing else on screen, so hiding it leaves a spinner with no way to tell thinking from hanging. The preference now governs only where the trace settles when the turn ends: kept as an appendix under the answer when on, gone when off. The live view is only the segment since the last tool call. `useChat` keeps the whole trace for storage and clears the visible segment each time a tool starts, so: ``` Reasoning (round 1) -> tool runs (reasoning clears) -> Reasoning (round 2) -> answer ``` Otherwise a research turn that thinks before each of a dozen calls stacks every round's reasoning on screen at once, and the tool it just asked for runs underneath a wall of text that is no longer about anything. ## Notes - New `src/lib/thinking.ts` holds the full/current split as pure functions, so the reset is tested without mounting the hook. - `npm test` (513 passed), `npm run typecheck`, `npm run lint:code`, and `npx vici build` all pass.
adrianbonpin added 1 commit 2026-10-06 14:18:38 +00:00
The transcript listed every tool call in order, so a research turn read
`_Tools: web_search, web_search, web_search, web_fetch (failed), ..._` over
three lines of the same two words. Each tool is now named once, in the order
it was first used, with the failures counted: `_Tools: web_search, web_fetch
(4 failed)_`.

`Show Tool Calls` now actually hides the list. The old rule kept the whole
list on screen whenever any call failed or was refused as a repeat, which is
what left the setting looking broken. Failures are still mentioned, in one
sentence and without the names: `_2 tool calls failed._`, or `_a call kept
repeating, so the turn was cut short._`.

Reasoning now streams into the transcript while a turn is in flight whatever
`Show Reasoning` says, because a model that is thinking rather than writing
has nothing else on screen; the preference governs only where the trace
settles once the turn ends. The live view is the segment since the last tool
call, cleared at each tool start and kept whole for storage, so a dozen
rounds of thinking no longer stack on screen at once.
adrianbonpin merged commit 550a2bbefe into prod 2026-10-06 14:18:51 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adrianbonpin/lam-agent-vicinae#18