[PR #12299] feat(acp): add session usage #14157

Closed
opened 2026-02-16 18:18:58 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12299

State: closed
Merged: Yes


This commit adds support for the unstable usage reporting over ACP: https://agentclientprotocol.com/rfds/session-usage

I decided to always calculate the totals on each message, but we could also decide to keep this as extra state for an ACP session, so we only need to look at the sdk response for the most recent message.

Closes https://github.com/anomalyco/opencode/issues/12298.

How did you verify your code works?

I verified this with Tidewave, which shows usage information in the UI if supported by the ACP agent.

image
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12299 **State:** closed **Merged:** Yes --- This commit adds support for the unstable usage reporting over ACP: https://agentclientprotocol.com/rfds/session-usage I decided to always calculate the totals on each message, but we could also decide to keep this as extra state for an ACP session, so we only need to look at the sdk response for the most recent message. Closes https://github.com/anomalyco/opencode/issues/12298. ### How did you verify your code works? I verified this with [Tidewave](https://tidewave.ai/), which shows usage information in the UI if supported by the ACP agent. <img width="447" height="236" alt="image" src="https://github.com/user-attachments/assets/588e7421-0568-429f-835f-7860617c1e96" />
yindo added the pull-request label 2026-02-16 18:18:58 -05:00
yindo closed this issue 2026-02-16 18:18:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14157