You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Investigate Codex usage across interrupted, replayed and resumed turns #1946
Verify Codex usage accounting independently of context occupancy and subscription quota display.
A pure-parser probe shows codex.extractUsage returns null for a token_usage_record with payload.usage while a turn.completed direct usage control parses correctly. Establish whether that record shape reaches the actual app-server/live or transcript-import path before claiming a production undercount. Existing token_count total snapshots are already treated differently from request deltas.
Acceptance criteria:
Exercise interrupted requests without following token_count, subsequent cumulative snapshots, replay of a sequence's first request, genuine resets, forks and restart/resume baselines.
Count each measured request once; preserve original timestamp, provider, observed model and any known tier. Unknown values remain unknown.
Keep cache/reasoning subsets and context-window occupancy separate from billable turn/session totals.
Make skipped/inconsistent-record coverage visible if a transcript accounting path is introduced; deduplicate sources by identity and bound rescans/cache invalidation.
Capture focused failures against the baseline before changing runtime accounting.
Coordinate with #1928 for per-model ledger storage and #1904 for limits/recovery. Tracked by #1926. Tests should use isolated fixtures without paid turns or real account data.
Additional normalization evidence: an isolated extractUsage(turn.completed) input with input_tokens=100, cached_input_tokens=80, output_tokens=2 and reasoning_output_tokens=1 yields only inputTokens=100/outputTokens=2/contextTokens=102, dropping the cache/reasoning subsets. The app-server breakdownToJsonl adapter similarly copies input/output/total only.
Add cache/reasoning preservation to the fixture matrix and distinguish inclusive provider input tokens from Solenta's uncached-input ledger convention before pricing. This confirms field loss at those helper boundaries; a live billing discrepancy and all provider event variants remain unverified. Keep this implementation separate from the #1928 ledger/filter worker's current scope.
Activity
currentbits commentedon Nov 8, 2026
Note
🤖 gpt-6.1-sol responding on behalf of currentbits
Additional normalization evidence: an isolated extractUsage(turn.completed) input with input_tokens=100, cached_input_tokens=80, output_tokens=2 and reasoning_output_tokens=1 yields only inputTokens=100/outputTokens=2/contextTokens=102, dropping the cache/reasoning subsets. The app-server breakdownToJsonl adapter similarly copies input/output/total only.
Add cache/reasoning preservation to the fixture matrix and distinguish inclusive provider input tokens from Solenta's uncached-input ledger convention before pricing. This confirms field loss at those helper boundaries; a live billing discrepancy and all provider event variants remain unverified. Keep this implementation separate from the #1928 ledger/filter worker's current scope.