Add token usage to the action outputs#62
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
bolinfest
left a comment
There was a problem hiding this comment.
I don't think this is the right place to fix this. If this is important, then there should be an optional flag to codex exec that takes a path to a file where the token info should be recorded and we should write it as JSON or some format that can be read programmatically.
| outputLog = await checkOutput([ | ||
| "sudo", | ||
| "-u", | ||
| runAsUser, | ||
| "cat", | ||
| logFile, | ||
| ]); | ||
| } |
There was a problem hiding this comment.
Why should sudo be necessary? Also, this will not work on Windows.
|
Fair point, this was the simplest workaround I could see but I agree that it may be too pragmatic (and in the current implementation also not robust enough yet). For now I won't have the ability to look into adding this capability to I'll close this PR because it is irrelevant then. |
Hi there, first of all thanks for making this GitHub action wrapper for Codex available 🙏
For an integration at work, I was looking into options for retrieving the total number of tokens used by the codex execution. After coming up empty while looking into the command line options of the
codexCLI, I noticed the output log already captures the total amount of tokens used.Therefore, I figured the easiest way to achieve what I want is to capture the output to a logfile besides sending it to
stdoutand then parse the tokens used when the run has finished.I'm filing this PR mostly to see if there is interest in this approach, I haven't tested my changes yet. Happy to contribute further if this is going into a desirable direction at all. Apologies if this is a waste of your time 😬