Tracking Codex Astra costs took more than updating a price table
Описание и применение
CLI agent‑cost теперь корректно рассчитывает стоимость использования Codex GPT‑6 Astra, правильно применяя режим Fast и отмечая незаписанные токены как unpriced, обеспечивая прозрачные оценки.
Задача
The agent-cost CLI could not correctly price Codex GPT‑6 Astra usage, treating Fast mode as Standard and leaving some usage unpriced.
Результат
Fast‑mode usage is now priced correctly; ambiguous settings remain unpriced with tokens preserved, providing transparent cost estimates.
Рабочий процесс
- 1. Update agent‑cost to v0.1.1 and add Astra rates to price catalog.
- 2. Run synthetic tests with 2M cached, 2M uncached, 2M output tokens.
- 3. Identify log settings (Standard, Fast, Unknown).
- 4. Detect service_tier and model name; apply multiplier only when mode is clear.
- 5. Mark ambiguous or missing settings as unpriced and record unpriced_tokens.
- 6. Generate report with pricing_status, estimated USD, credits, and unpriced token count.
- 7. Verify output via uvx commands (doctor, report).
Доказательства
After adding Astra to the price table, I tested it with synthetic logs. Usage marked as Fast was still being priced at the Standard rate.
The fix involved both detecting the mode and deciding what to do when the logs didn’t give me enough information.
Instead, usage stays unpriced when the reader can’t determine which rate applies.
- Дата записи: 2026-09-11T16:30:15.959Z