mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-11 02:46:45 +08:00
Codex reports reasoning tokens as a breakdown inside `output_tokens`, but both the app-server event path and the rollout JSONL fallback added them on top of the output total, inflating recorded output usage and the usage-based cost estimate. Consolidate both readers onto one shared conversion that keeps the provider's inclusive output total, preserving cache-bucket exclusivity, resume baselines and duplicate-snapshot handling. Add cross-provider contract tests covering both Codex sources and both Claude result formats. Verified against a live codex app-server session (codex-cli 0.144.6): the provider's own totalTokens equals input + output with reasoning not added, and the recorded buckets now sum to that total exactly. Previously persisted rows are not rewritten. Co-authored-by: importcpp <[email protected]>