opencodego: background refresh reports 100% free quota, manual refresh shows real quota
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Swift
- Stelle
- 22.8k
- Fork
- 2.2k
- Merge medio
- 21h 49m
- PR unite (30g)
- 368
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di steipete/CodexBar
-
Improve readability of red pace text in stacked menu bar layoutForse già presa @steipete l’ha presa 2 giorni fa. Apertaclawsweeper: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
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
steipete/CodexBar#4714 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Copilot: menu bar Pace token shows – for the monthly Premium quotaForse già presa @chriscorbell l’ha presa oggi. Apertaclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
steipete/CodexBar#4847 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
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 P2
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
steipete/CodexBar#4846 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider impact:ux-friction issue-rating: 🦞 diamond lobster P2
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
steipete/CodexBar#4845 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster P2
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
steipete/CodexBar#4844 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di steipete/CodexBar
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Provenance-Emu/SkinKit#42 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
lwouis/alt-tab-macos#6154 ·
-
bug mac アプリ: コード アプリ: チャット 優先: 中 要トリアージ
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
yksr-melt/Meltype#1346 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100