Menu

Why Background Token Refreshes Overwrite Your Google Antigravity Session (and How Session Guards Fix It)
📰

Why Background Token Refreshes Overwrite Your Google Antigravity Session (and How Session Guards Fix It)

DEV Community: go·Akalak Kruaboon·28 minutes ago
#2T0J6rPN
#devtogo#devto#dev#account#swap
Long article (1199 words) — no AI summary yet.
Reading 0:00
15s threshold

If you juggle two or three Google accounts with Google Antigravity ( agy ), you eventually notice an odd bug after switching accounts manually. You switch to Account B, start a coding session, and an hour later Antigravity silently flips back to Account A.

No crash happened, and nobody ran a login command. Another agy process running in a forgotten terminal or IDE workspace simply refreshed its hourly OAuth token and wrote the updated credentials back into the shared local state under ~/.gemini .

Here is why that race happens, how the open-source terminal switcher agy-swap isolates switches and harvests background refreshes without clobbering your active account, and how to run two completely separate accounts side by side when you need concurrent agents.

Why switching accounts by hand often reverts an hour later

Both the standalone agy CLI and the Antigravity IDE read and write shared credential files under ~/.gemini alongside your system keychain entry.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.