opencodego: background refresh reports 100% free quota, manual refresh shows real quota
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Read Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift and the refresh pipeline’s applyProviderRefreshSuccess behavior to understand how a local estimate can replace an authoritative snapshot. Then inspect Tests/CodexBarTests/OpenCodeGoWebOverlayTests.swift and run the named regression test; done means background refresh preserves the prior snapshot when the web overlay is transiently unavailable, while the documented exemptions retain their fallback behavior. A linked open pull request (#4806) is already pursuing this fix.
Written by the indexing model from the issue text.
Description
Symptom
With the opencode-go provider in auto mode, every background (timer) refresh shows 100% free quota. A manual Refresh Now immediately loads the real quota. The next background tick clobbers it back to 100% free.
Root cause
OpenCodeGoLocalUsageFetchStrategy.snapshot(context:) (Sources/CodexBarCore/Providers/OpenCodeGo/OpenCodeGoProviderDescriptor.swift) unconditionally returns its local-only fallback (quotaIsAuthoritative=false, published as .estimated) when the web overlay is unavailable. The pipeline (applyProviderRefreshSuccess) then publishes that estimate over the last good authoritative snapshot.
Background ticks run under ProviderInteractionContext.background, where BrowserCookieAccessGate skips browser import (no-UI Keychain preflight) and CookieHeaderCache.observeForConditionalMutation can report .keychainTemporarilyUnavailable. So in the background there is usually no cookie, the web overlay resolves to nil, and the strategy publishes a pure-local estimate. A local DB with no recent costs yields 0% used percents, i.e. "100% free". Manual refresh runs as .userInitiated, the cookie import succeeds, and the real quota loads.
Deterministic repro (no UI screenshots possible — needs a real account plus a timed background tick)
New regression test background refresh preserves prior snapshot when cached web overlay is transiently unavailable (Tests/CodexBarTests/OpenCodeGoWebOverlayTests.swift) run against base 5f93dc306 fails exactly the buggy way — old code returns a local estimate with rollingUsagePercent: 0.0 instead of failing so the prior snapshot is preserved:
Expectation failed: an error was expected but none was thrown ...
sourceLabel: "local", ... rollingUsagePercent: 0.0 ...
dataConfidence: estimated
Fix (PR to follow)
In background auto-mode refreshes, throw instead of publishing a non-authoritative local-only result when a web overlay may still be reachable (cached session exists or Keychain read was gated). The failure path preserves the prior authoritative snapshot; the next manual refresh retries the overlay with interaction allowed. Exempt when the cookie cache is definitively empty (first-run/logged-out users keep the local estimate), when cookieSource is manual/off, and manual refreshes (unchanged fallback UX).
- Dominant language
- Swift
- Stars
- 22.8k
- Forks
- 2.2k
- Avg merge
- 22h 20m
- Merged PRs (30d)
- 380
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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
-
Improve readability of red pace text in stacked menu bar layoutPossibly taken @steipete claimed this 1 day ago. Openclawsweeper:fix-shape-clear clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🐚 platinum hermit P2
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
steipete/CodexBar#4714 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P3
Difficulty 5/5 Over a week Newbie friendliness 38/100
steipete/CodexBar#4833 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
MiniMax China web-session discovery does not include minimax.cnPossibly taken @tangwz claimed this today. Openclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster P2
Difficulty 4/5 3-5 days Newbie friendliness 35/100
steipete/CodexBar#4831 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
CodexBarClaudeWatchdog post-spawn setpgid EACCES race + kill(-pgid) can signal parent process groupPossibly taken @Quinnod345 claimed this 1 day ago. Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:crash-loop issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 4/5 3-5 days Newbie friendliness 35/100
steipete/CodexBar#4829 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider impact:ux-release-blocker issue-rating: 🦞 diamond lobster P0
Difficulty 4/5 3-5 days Newbie friendliness 43/100
steipete/CodexBar#4827 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in steipete/CodexBar
Similar issues
-
simulator-session.yml の simtunnel の固定先が古く、agentd が無いため simtunnel up --wait / status が準備完了を検知できないOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Ebullioscopic/Atoll#900 ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
apache/arrow-swift#203 ·