OpenCode Go: local estimate wins with an API key present, off by 76 points and rendered as "Lasts until reset"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- swift
- Domain
- api, authentication, cli
Research direction
Reproduce the report with codexbar usage --provider opencodego --format json, using the opencode-go entry in ~/.local/share/opencode/auth.json. Trace provider selection and the local/API usage paths to determine why the API path is not used or why it falls back. Done means the selected source and reported windows match the provider usage data, without misleading pace advice.
Written by the indexing model from the issue text.
Description
TL;DR: OpenCode Go reports source: "local" with dataConfidence: "estimated" even though an API key for that provider sits in ~/.local/share/opencode/auth.json. The estimates are off by up to 76 percentage points, and the pace line turns them into advice: the menu bar says "70% in reserve, Lasts until reset" while the account's own usage page shows 81% of the monthly window already spent.
Environment
- CodexBar 0.56.1 (132)
- macOS 26.6.2 (25G83), arm64
- Provider: OpenCode Go, subscribed plan
~/.local/share/opencode/auth.jsoncontains anopencode-goentry with"type": "api"and a key present
Observed
codexbar usage --provider opencodego --format json, read at 2026-08-30T15:30:32Z:
{"source":"local","usage":{"dataConfidence":"estimated",
"primary": {"usedPercent":0, "windowMinutes":300},
"secondary":{"usedPercent":3.9, "windowMinutes":10080},
"tertiary": {"usedPercent":5, "windowMinutes":43200}},
"pace":{
"secondary":{"stage":"farBehind","deltaPercent":-91,"expectedUsedPercent":95,
"summary":"91% in reserve | Expected 95% used | Lasts until reset"},
"tertiary": {"stage":"farBehind","deltaPercent":-70,"expectedUsedPercent":75,
"summary":"70% in reserve | Expected 75% used | Lasts until reset"}}}
The OpenCode Go usage page, read in the browser minutes apart:
| Window | Usage page | CodexBar | Gap |
|---|---|---|---|
| 5-hour | 91.4% used | 0% used | 91.4 |
| Weekly | 47.4% used | 3.9% used | 43.5 |
| Monthly | 81% used | 5% used | 76 |
The menu bar popover renders these as "5-hour 100% left", "Weekly 96% left", "Monthly 95% left", under the caption "Quota estimated from local usage history". Refreshing with ⌘R does not change them.
Why the pace line makes this worse
farBehind and "Lasts until reset" are derived from the local estimate, so a window that is 81% spent is presented as 70% in reserve with a reassurance that it will last. A wrong number is visible as a wrong number; a wrong number wearing a verdict is not.
Relation to earlier reports
- #3216, fixed by #3218 and merged 2026-08-26, covered the fraction heuristic misreading whole-percent API values. This install is 0.56.1 and carries that fix, and the shape here is different: the API path is not being taken at all.
- #2982 and #2993 covered auto mode presenting local estimates as authoritative when the cookie cache is empty. The failure mode looks the same, but #3065 since added public usage API support with an API key, and a usable key is present in
auth.json. The question is why the local strategy still wins.
What I did not check
I did not call GET /zen/go/v1/usage myself, so I cannot say whether the API returns correct figures for this account or whether CodexBar tried it and fell back. The comparison above is CodexBar's own CLI output against the account's usage page, read minutes apart with no activity in between.
- Dominant language
- Swift
- Stars
- 21.6k
- Forks
- 2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 385
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from steipete/CodexBar
-
clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🐚 platinum hermit P2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🌊 off-meta tidepool P3
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr impact:auth-provider impact:security issue-rating: 🌊 off-meta tidepool P2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
impact:ux-friction issue-rating: 🦪 silver shellfish P2
Difficulty 3/5 1-2 days Newbie friendliness 65/100
All issues in steipete/CodexBar
Similar issues
-
tvOS
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
skiptools/skip-fuse-ui#147 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
OneBusAway/onebusaway-ios#1438 · 1 reaction ·