Return token usage in ACP prompt responses#283
Conversation
Capture Codex token count events during a prompt turn and map the final turn delta into PromptResponse.usage. Preserve existing context-window UsageUpdate notifications while returning ACP usage to clients.
|
Related issue: #282 |
|
Thanks for opening this. I think this is an important PR for ACP clients, because it fills the missing There is also a related user-facing need here: editor clients should be able to show context-window pressure, e.g. If the maintainers would prefer to keep this PR narrowly focused, I would be happy to help with a smaller follow-up PR that only adjusts |
|
@benbrandt Sorry for the direct ping — could you take a look at this PR when you have a chance? This is fixing a real problem for my ACP client. The final token usage for a prompt turn isn’t currently making it into Do you think this approach looks OK to merge, or would you prefer a different solution? I’m happy to adjust it however you think is best. @phplego Thanks for the comment! I think what you’re asking for is useful too, but it feels like a related follow-up rather than the same issue. If this PR can get merged first, I’d be happy to help with the context-window pressure part afterward. |
Capture Codex token count events during a prompt turn and map the final turn delta into PromptResponse.usage. Preserve existing context-window UsageUpdate notifications while returning ACP usage to clients.