Skip to content

Commit 8e7e890

Browse files
committed
test(codex): update cost expectations after reasoning token fix
Updated test expectations in daily-report.ts and monthly-report.ts to reflect the corrected cost calculations after fixing the reasoning token double-counting bug. The tests now expect the accurate cost values that exclude the erroneous addition of reasoning_output_tokens to output_tokens. Changes: - Fixed expected cost calculation from 250 tokens to 200 tokens for gpt-5-mini output - Added clarifying comments explaining the token breakdown for each model - Ensures test accuracy with the corrected calculateCostUSD implementation Test breakdown: - gpt-5: 800 non-cached input @ $1.25/M, 200 cached @ $0.125/M, 500 output @ $10/M - gpt-5-mini: 300 non-cached input @ $0.6/M, 100 cached @ $0.06/M, 200 output @ $2/M (reasoning tokens already included in output count) This change maintains test coverage while validating the accurate cost calculation behavior after the reasoning token double-counting fix.
1 parent 9b22b5b commit 8e7e890

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎apps/codex/src/daily-report.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,14 @@ if (import.meta.vitest != null) {
163163
expect(first.cachedInputTokens).toBe(300);
164164
expect(first.outputTokens).toBe(700);
165165
expect(first.reasoningOutputTokens).toBe(50);
166+
// gpt-5: 800 non-cached input @ 1.25, 200 cached @ 0.125, 500 output @ 10
167+
// gpt-5-mini: 300 non-cached input @ 0.6, 100 cached @ 0.06, 200 output @ 2 (reasoning already included)
166168
const expectedCost = (800 / 1_000_000) * 1.25
167169
+ (200 / 1_000_000) * 0.125
168170
+ (500 / 1_000_000) * 10
169171
+ (300 / 1_000_000) * 0.6
170172
+ (100 / 1_000_000) * 0.06
171-
+ (250 / 1_000_000) * 2;
173+
+ (200 / 1_000_000) * 2;
172174
expect(first.costUSD).toBeCloseTo(expectedCost, 10);
173175
});
174176
});

‎apps/codex/src/monthly-report.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ if (import.meta.vitest != null) {
170170
expect(first.cachedInputTokens).toBe(300);
171171
expect(first.outputTokens).toBe(700);
172172
expect(first.reasoningOutputTokens).toBe(50);
173+
// gpt-5: 800 non-cached input @ 1.25, 200 cached @ 0.125, 500 output @ 10
174+
// gpt-5-mini: 300 non-cached input @ 0.6, 100 cached @ 0.06, 200 output @ 2 (reasoning already included)
173175
const expectedCost = (800 / 1_000_000) * 1.25
174176
+ (200 / 1_000_000) * 0.125
175177
+ (500 / 1_000_000) * 10
176178
+ (300 / 1_000_000) * 0.6
177179
+ (100 / 1_000_000) * 0.06
178-
+ (250 / 1_000_000) * 2;
180+
+ (200 / 1_000_000) * 2;
179181
expect(first.costUSD).toBeCloseTo(expectedCost, 10);
180182
});
181183
});

0 commit comments

Comments
 (0)