You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
🐛 Shared Claude login: central refresh can lose the rotated grant on a failed write (close the lost-write window) #18775
Follow-up safety review of #18736 (hive refreshes the shared Claude OAuth grant itself).
Confirmed gaps in src/crux/agent/claude_shared_refresh.go:
Lost-write window. The provider rotates the refresh token on a successful refresh. If claude.WriteCredentials then fails (disk full, permission, crash), the new refresh token exists only in memory and is dropped. The next attempt presents the old, dead token, gets invalid_grant, rejectedExpiresAt is set and the credential is never retried: the fleet is signed out until a person signs in.
No test covers a failed write after a successful refresh.
invalid_grant is marked "rejected, never retry" without first checking whether a newer grant is known (memory, pending file, newer credential promoted by the bridge or the session adopt-back).
Three writers of the shared file (central refresher, agent bridge promote-on-race, session adopt-back) do not share one "replace only if strictly newer" function.
Running CLIs picking up a rewritten login is unverified; needs a documented live check.
Plan: hold the new grant in memory and in a root-only .credentials.pending file (fsynced) before the main write, retry the write with backoff before any further token-endpoint call, adopt a newer pending grant on boot, raise a loud alert if it cannot be written, reconcile before marking a grant rejected, and route all three writers through one shared function. Synthetic credentials and a fake token endpoint only.
Activity
clubanderson commentedon Nov 17, 2026
Claimed: working on this now on branch fix/shared-refresh-lost-write (worktree off fresh origin/v5).
hivecommons-hive commentedon Nov 17, 2026
Thanks for filing this issue! To help us reproduce and investigate, could you please include the commit SHA of the build you're running?
You can find it by running:
Or check the bottom of the console UI for the version string.
This issue will be on hold until a SHA is provided. Simply add a comment with the SHA and the label will be automatically removed.
clubanderson commentedon Nov 17, 2026
Fixed by #18776, merge commit eed08d8.
🐛 claude: keep the rotated shared-login grant until it is durably wri…