Skip to content

feat: add chat summary popover and per-chat cost endpoint#26649

Draft
jaaydenh wants to merge 1 commit into
chat-summary-62j9from
chat-summary-4kfj
Draft

feat: add chat summary popover and per-chat cost endpoint#26649
jaaydenh wants to merge 1 commit into
chat-summary-62j9from
chat-summary-4kfj

Conversation

@jaaydenh

@jaaydenh jaaydenh commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Stacked on #26657 (the persisted whole-chat summary backend). Base branch is chat-summary-62j9; review/merge that first.

Adds a reusable ChatSummary component surfaced via an info (i) button placed to the left of the chat sharing button in the chat header. The button opens a "Summary" popover (400px on desktop, full width on mobile) showing the chat's Summary, Created:, Updated:, and Cost:.

The summary text is the persisted whole-chat summary (chat.summary) introduced by #26657. It is generated asynchronously and may be null until the first summary is produced, in which case the popover renders a muted empty state. Live updates arrive via that PR's chat_summary_change watch event, which is already merged into the chat caches.

Cost is served by a new per-chat endpoint, GET /api/experimental/chats/{chat}/cost, which rolls up assistant-message cost across a chat's root and child (subagent) chats and is authorized like the other {chat} routes (read on the chat, 404 otherwise).

Visual and interaction coverage lives in ChatSummary.stories.tsx and ChatSummaryPopover.stories.tsx (including populated-summary, empty-state, and cost-loading cases).

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/admin/security/audit-logs.md

Add a reusable ChatSummary component surfaced via an info button placed to
the left of the chat sharing button in the chat header. The button opens a
"Summary" popover (400px on desktop, full width on mobile) showing the
chat's summary plus its Created/Updated dates and cumulative cost.

The summary text is the persisted whole-chat summary (chat.summary) from the
backend summary feature this branch is stacked on. It is generated
asynchronously and may be null until the first summary is produced, in which
case the popover renders a muted empty state.

Cost is served by a new per-chat endpoint, GET
/api/experimental/chats/{chat}/cost, that rolls up assistant-message cost
across a chat's root and child (subagent) chats and is authorized like the
other {chat} routes.
@jaaydenh jaaydenh force-pushed the chat-summary-4kfj branch from 28cda13 to aa80827 Compare June 24, 2026 12:56
@jaaydenh jaaydenh changed the base branch from main to chat-summary-62j9 June 24, 2026 12:56
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