Skip to content

Emit log message with token usage when Codex is interrupted #8785

@amir-irregular

Description

@amir-irregular

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions