Token usage: keep cache/reasoning split, count only recorded steps, cost only when positive; captures fixture, docs and notes

This commit is contained in:
2026-11-03 22:16:49 +00:00
parent aa948bdfe4
commit 3227d61caf
19 changed files with 447 additions and 61 deletions
+6
View File
@@ -37,6 +37,12 @@ type UsageTotals struct {
SplitUnknownStages int `json:"split_unknown_stages,omitempty"`
CostKnownStages int `json:"cost_known_stages"`
CostUnknownStages int `json:"cost_unknown_stages,omitempty"`
// The cache/reasoning components, as in RunUsage.
TokensReasoning int64 `json:"tokens_reasoning,omitempty"`
CacheRead int64 `json:"cache_read,omitempty"`
CacheWrite int64 `json:"cache_write,omitempty"`
CacheKnown bool `json:"cache_known,omitempty"`
CacheKnownStages int `json:"cache_known_stages,omitempty"`
}
type UsageStats struct {