Summary
CodexBar 0.26.1 can show a large gpt-5 cost/token bucket even when the local Codex session JSONL only records gpt-5.5 turns.
Reproduction evidence
On a local Homebrew-installed CodexBar 0.26.1 build, the cost history tooltip showed for 2026-05-18:
gpt-5: about 22M tokens / $5.59
gpt-5.5: about 3.8M tokens / $3.72
The generated cache at ~/Library/Caches/CodexBar/cost-usage/codex-v6.json had the same split:
"2026-05-18": {
"codex-auto-review": [97987, 48256, 145],
"gpt-5.5": [3826443, 3471104, 6845],
"gpt-5": [21808861, 20239872, 109701]
}
But scanning the raw ~/.codex/sessions/2026/05/18/*.jsonl files directly showed turn_context models as gpt-5.5 / codex-auto-review, with only one zero-token fallback attribution to gpt-5.
Likely cause
CostUsageScanner.parseCodexFile allows Codex lines up to 256 KiB, but only retains a 32 KiB prefix. Current Codex turn_context rows can exceed 32 KiB. One real turn_context row was 33,922 bytes and contained payload.model = gpt-5.5. When that row is treated as truncated and skipped, subsequent token_count events without an explicit model fall back to gpt-5, causing the cost history to over-report gpt-5.
Expected behavior
Long turn_context rows should still preserve model attribution for following token_count events, and existing bad Codex cost caches should be invalidated so the UI recalculates the corrected model split.
Version
Observed with Homebrew-installed CodexBar 0.26.1. The same prefixBytes = 32 * 1024 pattern is still present on current main as of 2026-05-18.
Summary
CodexBar 0.26.1 can show a large
gpt-5cost/token bucket even when the local Codex session JSONL only recordsgpt-5.5turns.Reproduction evidence
On a local Homebrew-installed CodexBar 0.26.1 build, the cost history tooltip showed for 2026-05-18:
gpt-5: about 22M tokens / $5.59gpt-5.5: about 3.8M tokens / $3.72The generated cache at
~/Library/Caches/CodexBar/cost-usage/codex-v6.jsonhad the same split:But scanning the raw
~/.codex/sessions/2026/05/18/*.jsonlfiles directly showedturn_contextmodels asgpt-5.5/codex-auto-review, with only one zero-token fallback attribution togpt-5.Likely cause
CostUsageScanner.parseCodexFileallows Codex lines up to 256 KiB, but only retains a 32 KiB prefix. Current Codexturn_contextrows can exceed 32 KiB. One realturn_contextrow was 33,922 bytes and containedpayload.model = gpt-5.5. When that row is treated as truncated and skipped, subsequenttoken_countevents without an explicit model fall back togpt-5, causing the cost history to over-reportgpt-5.Expected behavior
Long
turn_contextrows should still preserve model attribution for followingtoken_countevents, and existing bad Codex cost caches should be invalidated so the UI recalculates the corrected model split.Version
Observed with Homebrew-installed CodexBar 0.26.1. The same
prefixBytes = 32 * 1024pattern is still present on currentmainas of 2026-05-18.