Make model usage writes durable before chargeback is built on them #1286

Open
opened 2026-10-27 13:39:46 +00:00 by sam · 0 comments
Owner

A failed RecordUsage call is logged and dropped. Task usage can be rebuilt from agent_finish events, but chat, title, sampling and curator usage cannot. Before any chargeback reads model_usage, make the writes durable. Options: a local outbox that is retried until it succeeds, or writing task usage inside the FinishStep transaction. Done when a state store outage during model calls loses no usage rows once the store returns.

Acceptance criteria

Model usage records survive a State Store outage and are persisted once the store recovers.


Imported from beads archie-core-de651 · GitHub #1575 · type task · priority P2 · created 2026-10-10

A failed RecordUsage call is logged and dropped. Task usage can be rebuilt from agent_finish events, but chat, title, sampling and curator usage cannot. Before any chargeback reads model_usage, make the writes durable. Options: a local outbox that is retried until it succeeds, or writing task usage inside the FinishStep transaction. Done when a state store outage during model calls loses no usage rows once the store returns. ### Acceptance criteria Model usage records survive a State Store outage and are persisted once the store recovers. --- _Imported from beads `archie-core-de651` · GitHub #1575 · type task · priority P2 · created 2026-10-10_
sam added the mediumtask labels 2026-10-27 13:39:46 +00:00
sam self-assigned this 2026-10-27 13:39:46 +00:00
sam added the deferred label 2026-11-15 17:26:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1286