GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Return OpenCode Go usage with each response and keep it on the message · Issue #53044 · anomalyco/opencode

[FEATURE]: Return OpenCode Go usage with each response and keep it on the message #53044

New issue
Copy link
New issue
Copy link
Open
Open
[FEATURE]: Return OpenCode Go usage with each response and keep it on the message#53044
Copy link
Assignees
fwang

Description

@Fishforgithub
Fishforgithub
opened on Oct 4, 2026
Issue body actions

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

There is no way to see OpenCode Go usage from inside OpenCode; you have to open the console. #25875 and #27698 asked for it in the TUI. The usage endpoint from #16513 exists, but nothing in OpenCode uses it.

Proposal: the gateway already loads the Go usage on every request to check the limits, and already adds a cost field to each response (a ping chunk with cost at the end of streams). It could add the same { rolling, weekly, monthly } object that /zen/go/v1/usage returns, for example:

{ "type": "ping", "cost": "0", "goUsage": {
  "rolling": { "status": "ok", "percent": 62, "resetsAt": "2026-10-06T10:15:00Z" },
  "weekly":  { "status": "ok", "percent": 81, "resetsAt": "2026-10-12T00:00:00Z" },
  "monthly": { "status": "ok", "percent": 37, "resetsAt": "2026-10-18T03:20:00Z" } } }

OpenCode would then store it on the assistant message, next to tokens and cost.

What this gives:

  • The TUI can show Go usage (sidebar or footer) and keep it current without any extra request.
  • Nothing has to poll /zen/go/v1/usage. Status bars and tray apps can read the last value from the local database instead of calling the API with the user's key, the same way Codex writes rate_limits into its session log.
  • The key never leaves OpenCode.

The value only changes when Go is used through OpenCode, but resetsAt lets a reader handle resets without asking the server.

Context: I maintain a Windows tray app that shows plan usage for several coding tools. It only reads what the tools themselves record or report and never handles credentials, so today it can't support Go.

If you'd want the server side, I'm happy to send the client side (reading the field and storing it on the message). A smaller alternative would be an opencode usage --format json command over the existing endpoint.

Prior: #9281 and #40584 (closed), #32913 (CLI command plus endpoint, now conflicts with #16513), #41824 (exposing Go usage through the OpenCode server, closed by the PR cleanup).

Reacted by rayc0113, Fishforgithub and chinyuchiang

Activity

  1. github-actions
    assigned
    fwang
    on Oct 4, 2026
  2. github-actions commented on Oct 4, 2026

    @github-actions
    github-actionsBot
    on Oct 4, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • #27698: Requests showing OpenCode Go plan usage in the CLI itself.
    • #40584: Requests a /usage or /status command for Go plan limits, including rolling, weekly, and monthly windows.
    • #29634: Requests a CLI \usage command with usage statistics, quota, and reset timers.
  3. Fishforgithub commented on Oct 4, 2026

    @Fishforgithub
    Fishforgithub
    on Oct 4, 2026
    Author
    More actions

    Re the duplicate check: #27698, #25030 and #25875 were auto-closed for inactivity, and #40584 was closed in favour of #16017, which only added the server endpoint. This issue is the client side that is still missing. A TUI plugin (as suggested in #25875) could show the numbers inside OpenCode, but it would have to read the key itself, and it doesn't help tools outside OpenCode.

  4. Fishforgithub
    changed the title [-][FEATURE]: opencode usage command for OpenCode Go limits (with --format json)[/-] [+][FEATURE]: Return OpenCode Go usage with each response and keep it on the message[/+] on Oct 6, 2026
  5. opencodejr commented on Oct 27, 2026

    @opencodejr
    opencodejrBot
    on Oct 27, 2026
    Contributor
    More actions

    Thanks for the detailed proposal and the background on prior attempts!

    To restate it: you'd like the Go gateway to return the { rolling, weekly, monthly } usage with each response (for example on the final ping chunk next to cost), and OpenCode to store it on the assistant message. The TUI could then show it, and outside tools could read it locally without handling the API key.

    The main development branch has some related, unreleased work. OpenCode now reads /zen/go/v1/usage itself using the stored OpenCode Console sign-in, and the local OpenCode server exposes the result at GET /api/experimental/usage/limits. The response includes a go object with rolling, weekly and monthly, each with percent, limited and resetsAt. It's experimental and not in a release yet. Go usage still isn't recorded on messages, so your per-response proposal is still open. The endpoint may be enough for the TUI part, and for tools that can reach a running OpenCode.

    Related:

    • feat: expose Go and Zen usage #41824: closed PR that exposed Go usage through the OpenCode server (closest to the new experimental endpoint)
    • [FEATURE]: customizable status line with Go usage tracking #25875, [FEATURE]: Show the Opencode go plan usage stats in cli itself #27698: earlier requests to show Go usage in the TUI or CLI
    • feat(opencode): add CLI command to view Go usage limits #32913: closed PR adding a CLI command for Go usage
    • feat(console): add go usage endpoint #16513: closed PR that added /zen/go/v1/usage

    The maintainers will consider this. Thanks also for offering to write the client side.

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

Metadata

Metadata

Assignees

  • @fwang
    fwang

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

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.