Persist side-question spend separately from the running graph's checkpoints.
The sessions database owns this subtotal. Readers add it to the graph's total; it is never fed back into the graph's cost recorder or checkpoint channels. Failed charges retain only usage and pricing metadata, never the conversation. Once priced, a charge is retried without recalculating its price. Only successfully persisted charges survive a server restart.
Erase spend in the caller's thread-deletion transaction.
Retain only an ID tombstone to discard pending retries and late provider completions, including answers that have not written their first charge.
Retry pending settlements and read the durable subtotal.
Save completed usage before delivering an answer or finishing cancellation.
Additive token and estimated-cost accounting for one or more requests.
Agent state extended with the cumulative thread-cost channel.