SIGN IN SIGN UP

feat(ai): add run-level AI usage summary (#4758)

## Description

Adds a synthetic run-scoped `inngest.ai.summary` metadata kind aggregating `inngest.ai` usage across a run (tokens, cost, models, providers), computed at span-tree read time in the CQRS manager and never persisted. Step-scoped usage takes precedence over `extended_trace` duplicates.

Backend half of
[EXE-2087](https://linear.app/inngest/issue/EXE-2087/ai-metdatatraces-aggregate-gen-aiusage-across-runs-and-child).
Stacked under #4759 (UI); cloud counterpart: inngest/monorepo#8272.

## Release note

None (user-facing note on the UI PR).

## Migration note

None.
L
Linell Bonnette committed
8598962b3c53888c1df3c2be5aedcb1108ec7cac
Parent: cdd4185
Committed by GitHub <noreply@github.com> on 8/25/2026, 5:18:06 PM