Skip to content

ref(people): Attribute spend to the Turn Actor - #3023

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
ref/people-turn-spend
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
ref/people-turn-spend

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Spend now follows the Turn, not the Conversation. If Ana starts a Conversation and Ben runs a Turn in it, Ben's cost counts for Ben.

Behavior

  • The People list, the People profile, and personal spend (/api/people/me/spend and its version token) read cost, duration, and tokens from junior_conversation_metrics. They group by the Actor of each Turn and bucket by occurred_at.
  • Profile locations and surfaces for spend come from the root of each metric row's Conversation.
  • Someone who only ran Turns in other people's Conversations now appears in People. They show 0 Conversations, and their first and last seen times come from their Turns.
  • The tree rollup (peopleTreeMetricsJoin) is gone.

Write path

  • Metric rows get a nullable actor_identity_id, plus an index on (actor_identity_id, occurred_at).
  • The checkpoint path and the summary-only path in turn-cursor.ts pass the Identity of the Turn Actor. Child Task Turns already run as the Actor that invoked them.

Backfill (0091)

  • Old rows get the Actor of their own Conversation, else the Actor of its root.
  • Before this change, People could count a child's cost both for the root Actor and for the child's own Actor. After the backfill, each row counts once.

Stays on the root Actor: Conversation counts (conversations, active, failed, active days), the first and last seen times of people who started Conversations, and recent Conversations. Conversation detail and list costs stay per Conversation.

any-resource-event-automations and attachment-s3-storage also fail on main. The automation tests that failed during the full run pass when run alone. I did not run evals.

via @dcramer.

--

View Session [Sentry]

People spend, duration, and tokens now come from each Turn's metric rows,
grouped by the Actor of that Turn. Conversation counts stay on the Actor
that started each Conversation. Someone who only ran Turns in other
people's Conversations now appears in People.

Metric rows store the Turn Actor's Identity. A migration fills old rows
from the Actor of the row's Conversation, else its root.

Co-Authored-By: David Cramer <23610+dcramer@users.noreply.github.com>
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 9, 2026 5:23pm UTC

Request Review

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

14 screenshot changes — 14 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Page · Desktop
Automation Page · Desktop
Changed
Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Run Details Light · Desktop
Automation Run Details Light · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Show 8 more changed screenshots
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed
Conversation Unsent Answers · Mobile
Conversation Unsent Answers · Mobile
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 18dee136 Deployed Nov 9, 2026 by vercel[bot]
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