Skip to content

Make Gemini API Key optional for 3P use case#70

Open
jgindin wants to merge 1 commit into
mainfrom
gemini-optional
Open

Make Gemini API Key optional for 3P use case#70
jgindin wants to merge 1 commit into
mainfrom
gemini-optional

Conversation

@jgindin

@jgindin jgindin commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Use of a Gemini API key is now optional. If not provided, the chat panel won't be available, but everything else works.

Pre-launch Checklist

  • I signed the [CLA].
  • I read the [Contributors Guide].
  • I read the [Style Guide].
  • I have added updates to the [CHANGELOG].
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on fork, I have verified that scripts/e2e_test.sh passes.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ A2UI Composer PR Preview

Your automated preview is successfully live:
👉 Launch PR Preview

Note: This environment will be wiped automatically when the PR is merged or closed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the application behavior in third-party (3P) environments when the Gemini API key is missing. Instead of blocking startup and forcing a redirect to the settings page, the application now boots successfully but disables the Gemini Assistant chat panel, displaying a notice to add the key. The settings form has been updated to no longer require the API key as a mandatory field in 3P mode. Feedback on these changes suggests using .trim() when checking for an empty API key to handle whitespace-only values robustly, and using a neutral color instead of an error color for the non-blocking warning hint in the settings view to avoid misleading users.

Comment thread shell/src/app/chat/chat-panel/chat-panel.ts
Comment thread shell/src/app/settings/settings-view/settings.scss
- Modify StartupResolution.isEnvironmentValid to no longer require
  Gemini API key.
- Remove required validator from apiKey control in settings view.
- Update settings template to show a hint warning that Gemini Assistant
  won't be available when API key is empty.
- Add computed property to disable chat panel when API key is empty in
  3P mode.
- Render disabled panel placeholder with a button to add the API key in
  settings.
- Update tests for StartupResolution, Settings and ChatPanel to assert
  correct behavior.
- Fix and add E2E integration tests to reflect optional API key.
- Trim Gemini API key in LocalStorageAppConfigProvider on bootstrap and
  on setGeminiApiKey to prevent whitespace-only bypasses.
- Change settings warning-hint color to neutral surface variant.
- Update unit tests in local-storage-config.provider.spec.ts to verify
  whitespace trimming on bootstrap and save.

TAG=agy
CONV=972319b8-7f8f-47e0-b4a9-3c7422d69fb1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant