Version: agy 1.3.6 on macOS 27.2 (Apple Silicon), Google AI Pro sign-in. The 1.4.0 changelog does not mention this, so it may still apply.
What happens
An agent turn that is already running fails with:
UNAUTHENTICATED (code 401): Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.
It happens 0 to 3 minutes after the CLI’s hourly token refresh. The refresh itself succeeds, and the next message works without signing in again. The turn that was running is lost.
Evidence (one session, ~/.gemini/antigravity-cli/log/cli-*.log, times in UTC+3)
token refreshed, new expiry=...every hour at HH:35:32 (18:35 to 01:35), each with an expiry one hour later.agent executor error: generating and executing: UNAUTHENTICATED (code 401)at 01:36:53, 19:36:22, 20:35:50 and 22:36:18 on 16 Oct, and 01:38:17 on 17 Oct. Every one comes 0 to 3 minutes after a refresh.- Example: the previous token’s expiry was 01:35:31; the refresh ran at 01:35:32, one second after that expiry. A turn that started at 01:34:26 failed at 01:38:17. Error ID 11271020-936f-4a3c-953c-51cce2a5c2d1-287.
Likely cause
The refresh fires at the old token’s expiry rather than before it, and a turn that started earlier keeps using the old access token.
Expected
Refresh a few minutes before expiry, and let an in-flight request that gets a 401 retry once with the new token.
Repro
Keep a long, tool-using agent turn running across HH:35, for example one started a minute before the hourly refresh.
Workaround today
Sending a new message continues fine, but the interrupted turn’s work has to be redone.