Skip to content

feat: provider usage for the bighelp app (2.18.0) - #63

Merged
promptclickrun merged 2 commits into
mainfrom
feat/provider-usage
Sep 28, 2026
Merged

promptclickrun merged 2 commits into
mainfrom
feat/provider-usage

Conversation

@promptclickrun

Copy link
Copy Markdown
Owner

Closes #3 (plugin side). The app's Usage sheet comes next and will pin this release.

What it does

POST /native/usage/list (native-provider-usage-v1) finds the AI tools on the host and reads each one's usage from its own source. Nothing to configure.

Tool Found when Source
Claude Claude Code installed/signed in, or Hermes Claude sign-in Claude's usage service: session, week, per-model weeks, extra usage
Codex Codex CLI, or Hermes Codex sign-in Codex CLI app server account/rateLimits/read; Hermes /usage for its own sign-in (a different account is listed separately)
GitHub Copilot Copilot CLI, GitHub CLI, or Hermes token GitHub Copilot usage; Copilot CLI account.getQuota fallback (approximate). After ghc-usage-hermes
Google AI Studio Hermes Gemini key, or Gemini CLI Key check only: Google has no usage API for AI Studio keys; links to the usage page
OpenCode OpenCode CLI, or OpenCode Go/Zen key opencode stats (7 and 30 days); Go limits through Hermes
OpenRouter Hermes key /key and /credits
DeepSeek Hermes key /user/balance
Nous Portal Hermes signed in Hermes' Nous account info
Others Hermes provider plugin with fetch_account_usage That hook

Safety

  • Read-only. Borrowed CLI logins are never refreshed: their refresh tokens rotate, so refreshing would sign the CLI out. CLIs refresh their own logins. auth.adopt_external_logins: false also stops reading Claude Code's login.
  • Keys only go to their own provider, never across a redirect. No keys, emails or account IDs in responses (tested).
  • Hermes lookups run under the requested agent's profile. Cached 5 min; refresh throttled to 15 s; 20 s cap per provider, slow ones report a timeout.

Testing

  • tests/test_provider_usage.py: 25 tests, including fake Codex (JSON lines) and Copilot (Content-Length) servers and a fake opencode, redirect refusal, timeouts, caching, and the route through Hermes' real auth middleware.
  • Full suite: 1,124 tests. The same 19 fail on untouched main in my local environment (wiki, steering, packaged install); none are new.
  • Live on a Mac with everything installed, through the real route and real profiles: 7 providers in 1–2 s, 2.6 KB, and the active provider differs per agent as expected.

🤖 Generated with Claude Code

GordieBox and others added 2 commits September 27, 2026 15:39
POST /native/usage/list (native-provider-usage-v1) finds the AI tools on the
host and reads each one's current usage from its own source:

- Claude: Claude Code's login or Hermes' own Claude sign-in, via Claude's
  usage service (session, week, per-model weeks, extra usage)
- Codex: the Codex CLI's app server (account/rateLimits/read), or Hermes'
  /usage for its own sign-in; a different Hermes account is listed separately
- GitHub Copilot: GitHub's Copilot usage with Hermes' token order, the Copilot
  CLI's account.getQuota as a fallback (after ghc-usage-hermes)
- OpenCode (opencode stats, OpenCode Go through Hermes), OpenRouter, DeepSeek,
  Nous Portal, and any Hermes provider plugin with a usage hook
- Google AI Studio: checks the key works; Google publishes no usage API

Read-only: borrowed CLI logins are never refreshed (refresh tokens rotate, so
that would sign the CLI out), CLIs refresh their own. Keys only go to their
provider and never follow redirects; no keys, emails or account IDs reach the
app. Hermes lookups use the requested agent's profile. Cached five minutes,
refresh throttled to 15 s, 20 s per provider.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@promptclickrun
promptclickrun merged commit 095739e into main Sep 28, 2026
2 checks passed
@promptclickrun
promptclickrun deleted the feat/provider-usage branch September 28, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto discover current providers and display usage in app

1 participant