Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
302b654
Pin bundled pricing tables
Finesssee Oct 10, 2026
c5f035d
Build pricing tables from const rate rows
Finesssee Oct 10, 2026
bfe6548
Route Codex JSONL parses through one entry point
Finesssee Oct 10, 2026
18dd610
Pin Claude root walk results across scan paths
Finesssee Oct 10, 2026
4b356d6
Walk Claude transcript roots through one record stream
Finesssee Oct 10, 2026
c6f4c84
Delete unused Codex event structs from cost_scanner
Finesssee Oct 10, 2026
515a57d
Delete unused Claude quota history scan wrappers
Finesssee Oct 10, 2026
a4ddd2f
Share clamped file-length and epoch-millis helpers in cost_scanner
Finesssee Oct 10, 2026
d3fea1b
Mark unpriced models through one ModelPricingCompleteness method
Finesssee Oct 10, 2026
0bd79f9
Move test-only Codex cost helpers into codex_costs tests (RCO-19)
Finesssee Oct 10, 2026
7b43bfb
Fold identical Codex model-key branches (RCO-19)
Finesssee Oct 10, 2026
a5c040e
Pin spend activity histogram cells
Finesssee Oct 10, 2026
7b7d1c6
Count spend activity cells through one ActivityHistogram (RCO-20)
Finesssee Oct 10, 2026
9a82896
Share one add_optional across spend sources (RCO-20)
Finesssee Oct 10, 2026
680e2a6
Merge spend token classes in one loop (RCO-20)
Finesssee Oct 10, 2026
0c3049e
Share daily history slot, sort and Codex day helpers (RCO-24)
Finesssee Oct 10, 2026
1cdb06b
Count in-range Codex cache sessions through one helper (RCO-25)
Finesssee Oct 10, 2026
0f01140
Reuse the Codex sessions dirs within one detailed scan (RCO-25)
Finesssee Oct 10, 2026
29a45ed
Share Codex file billing, skip and unresolved-fork helpers (RCO-18)
Finesssee Oct 10, 2026
8743d28
Delete the unused duplicate Codex JSONL line bound
Finesssee Oct 10, 2026
d3d99be
Delete the unused fast Codex last-usage delta
Finesssee Oct 10, 2026
760d6cf
Move test-only Codex JSONL helpers into the scanner tests (RCO-03)
Finesssee Oct 10, 2026
ee45489
Drop the blanket dead_code allow on the JSONL scanner
Finesssee Oct 10, 2026
6b16b42
Move the test-only Codex display label lookup into pricing tests (RCO…
Finesssee Oct 10, 2026
279e208
Move the test-only model name formatter into pricing tests (RCO-03)
Finesssee Oct 10, 2026
1c957c8
Move the test-only snapshot Codex cost wrapper into pricing tests (RC…
Finesssee Oct 10, 2026
c4bb492
Move the test-only Claude pricing oracle into scanner tests (RCO-03)
Finesssee Oct 10, 2026
bf31916
Move test-only Claude record readers into scanner tests (RCO-03)
Finesssee Oct 10, 2026
4966ab5
Move the test-only pi entry filter into its tests (RCO-03)
Finesssee Oct 10, 2026
fe7c39d
Share one CostUsageFileUsage test fixture (TST-06)
Finesssee Oct 10, 2026
2a40cdb
Table-drive the single-assert pricing tests (TST-05)
Finesssee Oct 10, 2026
ebb53a1
Pin the live host-cost renderer's dash, partial and local-title text
Finesssee Oct 10, 2026
35d4b29
Share cost scanner test setup through a support module (TST-01)
Finesssee Oct 10, 2026
3e0484a
Move the pi session cost tests into their own file
Finesssee Oct 10, 2026
8c89800
Split the cost scanner tests by topic
Finesssee Oct 10, 2026
9b15257
Split the Codex JSONL scanner tests by topic
Finesssee Oct 10, 2026
6330fb7
Split custom pricing and the merge helpers out of the spend contract
Finesssee Oct 10, 2026
fd9f7a4
Move the JSONL scanner cache load and save code into its own module
Finesssee Oct 10, 2026
7a24de4
Move the daily cost and token history out of the cost scanner
Finesssee Oct 10, 2026
5e69dc8
Move the Claude transcript file scan out of the cost scanner
Finesssee Oct 10, 2026
d557021
Move the Claude transcript row types out of the cost scanner
Finesssee Oct 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
605 changes: 24 additions & 581 deletions rust/src/codex_costs.rs

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions rust/src/codex_costs/host_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,28 @@ mod tests {
assert!(text.contains("Snapshot updated: 2000-01-01T00:00:00Z"));
assert!(text.contains("Day boundaries: Asia/Tokyo"));
}

#[test]
fn local_text_shows_unknown_values_as_dashes_and_flags_partial_history() {
let partial = CodexCostSummary::from_summaries_at(
&CostSummary::default(),
&CostSummary::default(),
30,
chrono::DateTime::from_timestamp(1_700_000_000, 0).unwrap(),
"UTC",
);

let text =
render_codex_host_report(&CodexHostCostReport::success("local", "local", partial));

assert_eq!(
text,
"This machine — Codex API-equivalent estimate (not billed)\n\
Today: — · — tokens\n\
Last 30 days: — · — tokens\n\
Snapshot updated: 2023-11-14T22:13:20Z\n\
Day boundaries: UTC\n\
Partial history; scan is incomplete."
);
}
}
Loading