Skip to content

fix(quota): name the exact account in the best-available recommendation - #15

Open
mheers wants to merge 1 commit into
emmmdty:mainfrom
mheers:fix/quota-best-available-account
Open

mheers wants to merge 1 commit into
emmmdty:mainfrom
mheers:fix/quota-best-available-account

Conversation

@mheers

@mheers mheers commented Nov 17, 2026

Copy link
Copy Markdown

Summary

token-usage quota recommends the account with the most headroom as
Best available: <provider>. When one provider holds several accounts,
that line does not say which account was actually picked.

This renders the provider plus the exact account identity instead:

Best available: <provider> · <account>

(Placeholders are intentional; no real account data is included.)

Related issues

None.

Changes

  • findBestAccount returns the winning AccountResult instead of only the
    provider cell, so the recommendation carries the account identity.
  • New bestAccountLabel renders provider · account, using the same
    precedence as the account column (Usage.Account → AccountLabel → row
    name), and falls back to the provider alone when the row has no distinct
    account.
  • Both the table and compact renderer use the new label.
  • Tests cover the account suffix and the no-duplicate fallback.

Testing

  • go test -race ./...
  • go vet ./...
  • gofmt -l . (empty)
  • Manual check against a local config; output omitted because it
    contains account identifiers.

Checklist

  • I have read the contributing guidelines
  • I have added tests for new functionality
  • My changes follow the existing code style

One provider can hold several accounts, so recommending only the provider
name did not say which account actually has headroom. findBestAccount now
returns the winning row and bestAccountLabel renders provider plus account
identity, falling back to the provider alone when the row has no distinct
account.
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.

1 participant