Emit log message with token usage when Codex is interrupted
Resolved 💬 5 comments Opened Jan 6, 2026 by amir-irregular Closed Feb 23, 2026
What feature would you like to see?
When running Codex in autonomous mode, with codex exec --json, the program shows the token usage in the turn.completed event.
This appears only then Codex completed of its own accord, not when it was stopped from outside, e.g. due to timeout, or to machine shutting down. It's useful to get the token counts in these situations too.
Can you add a handler for the TurnAborted event that emits a log with the same usage field?
Additional information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗