codeburn/mac/Sources/CodeBurnMenubar
iamtoruk ca41021a51 fix(menubar): treat the CLI credential store as the source of truth
The menubar kept its own copy of each provider's OAuth grant and refreshed
it on a timer, racing the CLI. Both Claude and Codex use single-use refresh
tokens that rotate on every refresh, so the menubar's self-rotation could
invalidate the user's own CLI login and surfaced as "disconnected" after a
long idle period.

Codex: read ~/.codex/auth.json fresh each cycle; only self-refresh when
last_refresh is older than 8 days; on 401 re-read the source before spending
our token; write rotated tokens back to auth.json (atomic, preserving other
keys); recover from reuse/invalid_grant by re-reading instead of going
terminal.

Claude: never HTTP-refresh the CLI-owned token. On expiry/401 re-read the
keychain with a no-UI query (LAContext.interactionNotAllowed) to adopt a
token the CLI already rotated; when none is available yet, report a transient
sourceTokenStale rather than a terminal disconnect.
2026-05-31 05:01:19 -07:00
..
Data fix(menubar): treat the CLI credential store as the source of truth 2026-05-31 05:01:19 -07:00
Security feat(menubar): refresh via headless app binary instead of node script 2026-05-30 13:05:48 -07:00
Theme Harden menubar: fix refresh loop, concurrency, data sync, and edge cases 2026-05-01 08:01:25 -07:00
Views feat(menubar): show CLI update banner when a newer version is available 2026-05-27 06:27:49 -07:00
AppStore.swift fix(menubar): recover from stuck loading when in-flight entry is orphaned 2026-05-28 14:06:13 -07:00
AppVersion.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CodeBurnApp.swift refactor(menubar): remove dead distributed-notification listener 2026-05-31 05:01:10 -07:00
CurrencyState.swift Harden menubar: fix refresh loop, concurrency, data sync, and edge cases 2026-05-01 08:01:25 -07:00