ADFA-2709 | Verify API keys before saving and improve onboarding - #59
Open
jatezzz wants to merge 2 commits into
Open
ADFA-2709 | Verify API keys before saving and improve onboarding#59jatezzz wants to merge 2 commits into
jatezzz wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Adds live key validation via ai-core and links to AI Studio for easier setup.
jatezzz
force-pushed
the
feat/ADFA-2709-gemini-key-onboarding
branch
from
August 3, 2026 21:46
14fd407 to
dca709f
Compare
jatezzz
requested review from
a team,
Daniel-ADFA,
dara-abijo-adfa,
davidschachterADFA,
hal-eisen-adfa and
itsaky-adfa
August 3, 2026 21:46
Daniel-ADFA
reviewed
Aug 4, 2026
| "cross-plugin contract changed. Expected " + | ||
| "`fun listModels($signature): CompletableFuture<List<String>>`.", | ||
| e | ||
| ) |
Collaborator
There was a problem hiding this comment.
nitpick: prefer context.logger
Daniel-ADFA
reviewed
Aug 4, 2026
Comment on lines
+75
to
+78
| android.util.Log.w( | ||
| "KeyVerification", | ||
| "Unmapped ListModels HTTP $status; treating the key as unchecked, not rejected" | ||
| ) |
Collaborator
There was a problem hiding this comment.
please clean up logs or use context.logger for better log surfacing
Daniel-ADFA
reviewed
Aug 4, 2026
| * Anchored on the whole prefix, not a bare `HTTP \d{3}`: Google's error body is appended to that | ||
| * message, and a looser pattern could read a verdict on the key out of server-supplied text. | ||
| */ | ||
| private val HTTP_STATUS = Regex("""ListModels HTTP (\d{3})""") |
Collaborator
There was a problem hiding this comment.
maybe a better variable name for HTTP_STATUS since it's a failure?
…gger Replaces android.util.Log in the Gemini catalog gateway and AI settings ViewModel with the plugin's PluginLogger, so diagnostics surface in the IDE log view. Drops the redundant unmapped-status log from KeyVerification (the gateway already reports the cause) and renames the status regex to say it comes from a failure message.
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 improves the Gemini API key onboarding experience by guiding users to Google AI Studio and validating keys before they are saved to the device. This eliminates the need for users to navigate the complex Google Cloud Console and deal with manual billing/project setup.
[aistudio.google.com/apikey](https://aistudio.google.com/apikey)directly in the system browser.GeminiCatalogGateway. Keys that are rejected by Google are no longer saved.ai-coreplugin, the user is prompted with an option to save the unverified key anyway.GeminiErrorFormatterto cleanly translate failure states into user-friendly localized strings instead of dumping raw JSON payloads into the UI.Details
GeminiKeyOnboarding,KeyVerification, andCatalogResultto manage the validation logic and state.README.md/index.htmldocumentation to reflect the new AI Studio flow.🎦 Demo on the ticket to protect confidential information
Ticket
ADFA-2709
Observation
The verification step relies on a reflective call (
GeminiCatalogGateway) tolistModels(apiKey)in theai-coreplugin to maintain the cross-plugin architecture without adding new permissions to theai-assistantmanifest.