Repository navigation
Closed
Description
Personal spend leaves out conversations started from the dashboard web UI. This affects the 7d/30d spend in the profile menu and Usage Over Time on the People profile page. A single web conversation can cost more than the person's whole 7d or 30d total. Two separate defects cause this, and each one alone is enough to drop the cost. Conversation privacy is not a factor.
1. People spend queries match only Slack identities
verifiedActorWhereinpackages/junior/src/api/people/shared.tsrequiresjuniorIdentities.provider = "slack".spend.query.tsandprofile.query.tsboth use it.- Web actors are stored as
provider: "junior"identities (identityFromActorinchat/conversations/sql/actor-identity.ts). These identities have a verified email and a linkedjuniorUsersrow, but the provider filter still excludes them.
2. An event turn replaces the web root actor with the Local CLI system identity
- In
recordConversationActivityMetadata(chat/task-execution/turn-cursor.ts),activitySourceis"web"only when the Turn Source kind isweb. Web conversations use alocaldestination, so any other Source kind, such asevent, gives"local". sessionLogActordrops every actor whose platform is not Slack, so the write passesactor: undefined.SqlStore.recordExecution(chat/conversations/sql/store.ts) builds the conversation from its arguments alone and does not fall back to the saved actor.actorIdentityForConversationthen returns thelocal-clisystem identity, because the actor is missing and the source islocal.- The upsert uses
coalesce(excluded.actor_identity_id, existing), so the new value replaces the saved web actor.participants.tslists the root actor first, so the dashboard shows "Local CLI" as the first participant.
Reproduction (scratch integration test against Postgres, origin/main @ cd0acb345)
- Create a web conversation with
appendAndEnqueueWebMessageand run its turn throughcreateConversationTurnWorker. The root actor is thejunioruser identity for the test email, withemailVerified: trueand a linked user. - Give the conversation a nonzero
usage.cost.total.readPersonalSpendFromSqlfor that email still returnssevenDaysUsd: 0andthirtyDaysUsd: 0. - Add a watch on the conversation, enqueue one
pull_request.mergedevent withenqueueEventNotification, and run the event turn. The rootactor_identity_idnow points tojunior/local-cli(kind: system).
Unknowns
- Which event turn caused the overwrite in the originally reported conversation. It was not checked against production data.
- How many existing web conversation rows already have the
local-cliactor.
via David Cramer.
--
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(people): Keep web actors out of Slack fields and label them API
fix(conversations): Keep the root actor when later turns record execu…
fix(identity): Resolve web actors to their stored identity (#2437)
fix(people): Count dashboard conversations in personal spend (#2432)
fix(conversations): Refresh destination visibility only from live sig…
docs(openspec): Use the existing Owner column and migrate only proven…
sentry-junior commentedon Nov 9, 2026
Fixed on main: dashboard conversations count in personal spend (#2432), and web actors are kept and resolved (#2436, #2437).
Closed during a tracker cleanup. Reopen if something here is still missing.