feat(workspace): per-turn token + cost meter and reasoning blocks #566

Closed
opened 2026-04-30 16:53:07 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As an operator, I want to see per-turn cost / tokens / duration and any extended-thinking blocks the model emitted, so I know what each turn cost me and what the model considered.

Acceptance criteria

Per-turn meter

  • Each completed assistant bubble carries a footer pill showing <duration> · <input>+<output> tok · $<cost>. Data already lives in result.detail (see apps/server/src/infrastructure/event-log.ts:152).
  • Hover / focus reveals a tooltip with cache-creation + cache-read breakdown.
  • Session header shows running totals (sum across persisted turns).

Reasoning blocks

  • When the SDK emits a thinking block (Opus extended thinking), the transcript renders a collapsible "Reasoning" section above the assistant text. Default collapsed.
  • extractAssistantText is updated to skip thinking blocks for the streaming bubble's main text (renders separately).

Out of scope

  • Cost budgeting / cap UI (separate concern).

References

  • Data path: apps/server/src/infrastructure/agent/sdk-adapter.ts:107 (extractAssistantText) and event-log.ts:152 (result.detail).
  • Spec: specs/workspace-chat-overhaul.md § P3.
## User story As an operator, I want to see per-turn cost / tokens / duration and any extended-thinking blocks the model emitted, so I know what each turn cost me and what the model considered. ## Acceptance criteria ### Per-turn meter - [ ] Each completed assistant bubble carries a footer pill showing `<duration>` · `<input>+<output> tok` · `$<cost>`. Data already lives in `result.detail` (see `apps/server/src/infrastructure/event-log.ts:152`). - [ ] Hover / focus reveals a tooltip with cache-creation + cache-read breakdown. - [ ] Session header shows running totals (sum across persisted turns). ### Reasoning blocks - [ ] When the SDK emits a thinking block (Opus extended thinking), the transcript renders a collapsible "Reasoning" section above the assistant text. Default collapsed. - [ ] `extractAssistantText` is updated to skip thinking blocks for the streaming bubble's main text (renders separately). ## Out of scope - Cost budgeting / cap UI (separate concern). ## References - Data path: `apps/server/src/infrastructure/agent/sdk-adapter.ts:107` (`extractAssistantText`) and `event-log.ts:152` (`result.detail`). - Spec: `specs/workspace-chat-overhaul.md` § P3.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
charles/claude-hooks#566
No description provided.