Summary
On job completion, Tendril parses the agent's result event to store Jobs.Cost and Jobs.Tokens. The same event also carries per-model breakdown (modelUsage) and cache token counts (cache_read/cache_creation), which are currently discarded. This feature request is to persist this telemetry data to the database.
Proposed Solution
Minimal approach:
Add three columns to the Jobs table:
Model — which model was used
CacheReadTokens — cache read token count
CacheCreationTokens — cache creation token count
Fuller approach:
Create a JobModelUsage child table to store exact per-model splits for more detailed tracking.
Rationale
This enables:
- Cost & efficiency analytics queryable directly from SQL without re-parsing raw session logs
- Model routing analysis — identify which model ran at what cost to optimize routing toward cheaper options
- Cache economics analysis — understand cache hit/miss patterns and their cost impact
- Single source of truth — the database becomes the authoritative record for agent spend, rather than relying on rotating session logs
Notes
- Apply to new jobs only; no backfill of historical data required
Original Slack thread
Reported by Renco Smeding
Summary
On job completion, Tendril parses the agent's result event to store
Jobs.CostandJobs.Tokens. The same event also carries per-model breakdown (modelUsage) and cache token counts (cache_read/cache_creation), which are currently discarded. This feature request is to persist this telemetry data to the database.Proposed Solution
Minimal approach:
Add three columns to the
Jobstable:Model— which model was usedCacheReadTokens— cache read token countCacheCreationTokens— cache creation token countFuller approach:
Create a
JobModelUsagechild table to store exact per-model splits for more detailed tracking.Rationale
This enables:
Notes
Original Slack thread
Reported by Renco Smeding