fix: replies without reported token usage show an empty Info button (#33220)

A recent dev change marks a reply as having incomplete usage when the provider reports no token counts, so the session analytics can tell measured replies apart. The chat then treated that marker as usage and showed the Info button under every such reply, with a tooltip that only said "incomplete: true". The Info button now only appears when the reply carries actual usage data, while the stored marker stays as it is for analytics.
This commit is contained in:
Classic298 2026-10-26 20:44:49 +01:00 • committed by GitHub
parent 67875f7656
commit dacb2c25fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1205,7 +1205,7 @@
</Tooltip>
{/if}
{#if message.usage && $visibleControls['chat.usage']}
{#if Object.keys(message.usage ?? {}).some((key) => key !== 'incomplete') && $visibleControls['chat.usage']}
{@const usage = JSON.stringify(message.usage, null, 2)
.replace(/"([^(")"]+)":/g, '$1:')
.slice(1, -1)