fix(auth): canonicalize Google Antigravity provider and enhance credential management#2599
Merged
imguoguo merged 3 commits intosipeed:mainfrom Apr 21, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses inconsistent Google Antigravity credential expiry reporting by canonicalizing the legacy antigravity provider key to google-antigravity inside the auth store layer, ensuring CLI/Web UI read the same merged credential state.
Changes:
- Add provider key canonicalization + legacy/canonical merge logic in the auth store (preferring newer expiry and preserving non-empty fields).
- Update auth store tests to use a shared home override helper and add regression tests for alias merge/delete/normalization behavior.
- Add CLI
auth statusregression test to ensure only the canonical provider is displayed after refreshing credentials.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/auth/store.go | Canonicalizes provider names and merges legacy/canonical credentials during Load/Get/Set/Delete. |
| pkg/auth/store_test.go | Adds helpers and regression tests for alias merging, canonicalization, and deletion behavior. |
| cmd/picoclaw/internal/auth/status_test.go | Adds CLI output regression test covering the reported inconsistent expiry scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
imguoguo
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
This PR fixes the Google Antigravity credential expiry inconsistency reported in #2550.
The root cause was in the auth store layer rather than in the OAuth refresh flow itself. Historical
auth.jsonfiles could contain both the legacyantigravitykey and the canonicalgoogle-antigravitykey at the same time. In that state, Web UI code reading the canonical provider and CLIauth statusiterating the raw credential map could observe different expiry timestamps, making it look likepicoclaw auth login --provider google-antigravitydid not updateexpires_at.To fix this, the auth store now canonicalizes
antigravitytogoogle-antigravityon read/write, merges legacy and canonical entries into a single credential view, prefers the newer expiry when both exist, and preserves other fields such as refresh token, email, project ID, and account ID. The PR also adds regression coverage for the legacy alias merge path, alias deletion, provider normalization, and the CLIauth statusoutput path that matches the issue reproduction more closely.🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
Fixes #2550
📚 Technical Context
auth.json, not by a missing token refresh from the provider. Normalizing provider keys and merging legacy/canonical entries in the auth store ensures that CLI and Web UI read the same credential state and the refreshed expiry time is visible consistently after login.🧪 Test Environment
☑️ Checklist