mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 21:39:54 +02:00
Codex doesn't expose token usage through its JSON-RPC app-server protocol. The turn/completed and task_complete notifications don't contain usage fields. Fix: after Codex execution finishes, scan the on-disk session JSONL files (~/.codex/sessions/YYYY/MM/DD/*.jsonl) for token_count events. Only files modified after the task's start time are scanned, avoiding counting unrelated sessions. This matches the same data format the existing runtime_usage scanner reads.