fabro/lib
Bryan Helmkamp df8762663b Bill an agent stage's whole session tree from one fold
One usage rule: a stage's usage is its session tree's, the root and every
subagent, live and at completion. The worker's event sink folds pebble's
SessionProjection over the events it records and the stage's billing and
files come from that fold at stage end, so the completed values are what
the run showed live. The store's live usage is the fold's tree usage, and
completion brings the catalog's price for the same tokens instead of
resetting them to the root's.

Fabro keeps catalog pricing: the root at its route, each descendant at its
own route where the catalog knows it and at the root's otherwise, a
provider-reported cost standing in where pebble has one. The rows travel
as billing_by_model on stage.completed and the stage projection, and the
billing rollup splits by_model by them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 08:35:47 -06:00
..
apps Bill an agent stage's whole session tree from one fold 2026-09-13 08:35:47 -06:00
components Bill an agent stage's whole session tree from one fold 2026-09-13 08:35:47 -06:00
foundation Bill an agent stage's whole session tree from one fold 2026-09-13 08:35:47 -06:00
packages/fabro-api-client Describe StageProjection.agent on the API as pebble's own types 2026-09-13 08:35:07 -06:00