Skip to content

[FEATURE]: report plan usage (Go limits, Zen balance) to ACP clients #49693

Open

Description

@iamenahs

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

opencode acp already sends usage_update with the context size and the session's cost. What an ACP client still can't see is the account's plan standing:

Today an ACP client (Zed, HarnessDesk, others) has to find the user's key and call those endpoints itself, which it may not be able to do.

Suggestion: have the ACP server attach these figures itself. ACP has no standard plan-usage message yet, so _meta or an extension method is the sanctioned place. Either of these would work:

  • a _meta block on usage_update:
{ "sessionUpdate": "usage_update", "used": 53000, "size": 200000,
  "_meta": { "opencode": { "go": { "rolling": { "percent": 19.5, "resetsAt": "…" }, "weekly": { … }, "monthly": { … } } } } }
  • a custom request such as _opencode/usage, returning the same object.

In the meantime, HarnessDesk reads each session's cost from opencode.db (HarnessDesk/HarnessDesk#772), but that shows spend, not the plan's limits.

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed request, @iamenahs!

    To restate it: opencode acp should report the account's plan standing (Go's 5-hour, weekly and monthly usage, and the Zen balance) to ACP clients. That could be a _meta.opencode block on usage_update or an extension method such as _opencode/usage, so clients like Zed or HarnessDesk don't need the user's key to call the Console endpoints themselves.

    Some context: OpenCode v2 already fetches these limits (it's what the TUI's usage display shows, and the server exposes it as the usage.limits endpoint), but the ACP server currently sends only used, size and cost on usage_update. A plugin can't add this, because plugins have no hook into ACP session updates or extension methods.

    Related issues you mentioned:

    The maintainers will consider this request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions