Skip to content

Index agent message consumption analytics - #30203

Merged
flvndvd merged 8 commits into
mainfrom
flav/ingest-agent-message-consumption-analytics
Aug 10, 2026
Merged

Index agent message consumption analytics#30203
flvndvd merged 8 commits into
mainfrom
flav/ingest-agent-message-consumption-analytics

Conversation

@flvndvd

@flvndvd flvndvd commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

This PR indexes the consumption documents produced for each billed agent message. The existing attribution workflow now runs a second activity after attribution is stored, which loads the message data, builds its LLM and tool documents, and writes them to Elasticsearch.

Each indexing pass replaces the complete snapshot for the message. This prevents documents from an earlier message version from remaining in the index and being counted twice. Writes use deterministic IDs and failures are retried by Temporal.

It also ensures the authoritative bill and skill snapshot are persisted before attribution starts.

Tests

Risk

Deploy Plan

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
playground Ignored Ignored Preview Aug 10, 2026 8:39am
storybook Ignored Ignored Preview Aug 10, 2026 8:39am

Request Review

@dust-agent dust-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Rules LGTM \o/

Base automatically changed from flav/build-consumption-analytics-tool-documents to main August 7, 2026 15:54
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

Temporal workflow/activity files have been modified:
- front/temporal/agent_loop/activities/finalize.ts
- front/temporal/analytics_queue/activities/consumption_attribution.ts
- front/temporal/analytics_queue/workflows.ts

**IMPORTANT**: Renaming activity functions can cause non-deterministic errors in Temporal workflows.

Running workflows may still reference the old activity names, which will cause failures when they try to execute.

Best practices:
- **DO NOT** rename existing activity functions
- **DO** create new activities with new names if you need different behavior
- **DO** use activity versioning patterns if you must change activity signatures
- **DO** ensure all running workflows complete before removing old activities

If you're only adding new activities or fixing bugs within existing ones, this warning can be ignored.

Generated by 🚫 dangerJS against 3b626fb

@flvndvd
flvndvd force-pushed the flav/ingest-agent-message-consumption-analytics branch from e21e67d to 3b626fb Compare August 10, 2026 08:37
@flvndvd
flvndvd merged commit d5d39f4 into main Aug 10, 2026
46 checks passed
@flvndvd
flvndvd deleted the flav/ingest-agent-message-consumption-analytics branch August 10, 2026 09:26
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.

2 participants