feat(seer): add the agent conversation embeds - #123908
Merged
Merged
Conversation
Ran `pnpm gen:embed-widgets`. CI regenerates this file and fails if it is out of sync with schemas.ts. Claude-Session: https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ
The generic `<EmbedStory name="conversation" />` renders the schema's hardcoded example id, which resolves to nothing in a real org, so the storybook entry showed an empty transcript. Fetch a recent conversation from the agents conversations list instead and feed its id, title and time bounds into the tag -- the same pattern the monitor, replay, trace and saved issue view embeds already use. Claude-Session: https://claude.ai/code/session_01DwM6SuBXUTSXciHNCM59iR
Contributor
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-ays7039gs.sentry.dev |
Three changes to the conversation embeds: The conversation block dropped its transcript. The embed renders inside an agent conversation, so a nested transcript reads as part of the surrounding answer; the LLM call, token, cost and error totals say what the reader needs, and the link goes to the full detail view. Message selection went with it, so the block is no longer interactive at all. The conversationsQuery rows now link to their conversations, through the same `getConversationHref` the conversation embed uses. They open in a new tab so following one cannot replace the page holding the answer. Layout now matches the other embeds: `conversationsQuery` is flat in `components/` like every other query embed, `conversation/` keeps the single-resource embed like `monitor/` and `alert/`, each embed has its own colocated spec, and sibling imports are relative. Claude-Session: https://claude.ai/code/session_01DwM6SuBXUTSXciHNCM59iR
knip flagged it as an unused export: only `ConversationsQueryLink`, in the same file, calls it. `getConversationHref` stays exported -- the query block imports it for its row links. Claude-Session: https://claude.ai/code/session_01DwM6SuBXUTSXciHNCM59iR
Member
Author
|
bugbot review |
`useConversation` reads its project filter from `usePageFilters()`, which is right for the conversations route and wrong for an embed: the block passed the tag's `projects` to the link but not to the fetch, so a conversation outside the host page's selected projects came back with no spans and rendered the empty state. Add an optional `projects` to the hook's options, overriding the page filters when given. Every existing caller omits it and keeps the previous behaviour. Claude-Session: https://claude.ai/code/session_01DwM6SuBXUTSXciHNCM59iR
Member
Author
|
bugbot review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d721562. Configure here.
ryan953
reviewed
Sep 9, 2026
ryan953
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two Seer markdown embeds for Explore > Agents:
conversation— one AI agent conversation. Inline renders a link; block renders the transcript with its LLM call, token, cost and tool totals.conversationsQuery— the conversations list filtered by a search. Inline renders a link; block previews the first five matching rows with duration, message count, errors and cost.Both are gated on
organizations:gen-ai-conversations, which already exists intemporary.py, so neither reaches the agent until an org has it.The last of four independent branches adding single-resource Seer embeds — see also #123901 (profile), #123905 (event) and #123906 (log). They all touch
schemas.ts,index.ts, the stories page and the generated widget JSON, so whichever merges first leaves the rest needing a rebase plus apnpm gen:embed-widgetsre-run.Notes for review
Both blocks avoid the route-level machinery, because it is URL-coupled and an embed must not touch the host page's history (
embeds/README.md):useConversations, which takes no arguments and reads cursor/filters through nuqs.MessagesPanel+ConversationAggregatesBardirectly rather thanConversationViewContent, which writes its tab and detail-tab state back to the URL. Message selection is localuseState, with a test asserting the router never changes.Two shape details worth a look:
useConversationsnormalizesfirstInput/lastOutputbefore handing rows out, but the raw endpoint returnsstring | {type, text}[] | null. Since the block calls the endpoint directly, it flattens them itself, then strips markdown to a single line for the cell.agentURL param and folds it into the span query only when calling the API. The link mirrors the former, the block the latter, so both are filtered identically.Ordering also differs: the endpoint returns by relevance, and the list view sorts newest-first before rendering, so the preview re-sorts to match.
Testing
10 tests across both embeds — inline hrefs and their padded time windows, the transcript, aggregates, API-title-wins-over-tag-title, selection staying local, the error state, the row preview with ordering and formatting, content-part flattening, and the empty state. The whole
seer/markdownsuite passes; oxlint and oxfmt are clean, andpnpm gen:embed-widgetsproduces no diff.Closes https://linear.app/getsentry/issue/CW-2003/add-ai-conversations
🤖 Generated with Claude Code
https://claude.ai/code/session_016YUmhMZLo8geXJa93daPEQ