Add Gemini priority service tier support to the agent#19
Conversation
Allow selecting a Gemini API service tier (Standard or Priority) for the agent's LLM calls. Priority requests lower-latency, higher-priority processing via the `service_tier` request field; Standard omits the field to use the API default. - Add ServiceTier enum and persist the selection in DataStore settings - Plumb serviceTier through LlmProvider.generateResponse and the AgentOrchestrator interaction loop - Send `service_tier` in the Gemini request, log the served tier, and warn when a priority request is downgraded (priority quota exhausted) - Add a tier selector to the Settings screen - Cover the new behaviour with unit tests and a screenshot test
There was a problem hiding this comment.
Code Review
This pull request introduces support for selecting and requesting a specific service tier (Standard or Priority) for Gemini API calls. It adds a new ServiceTier enum, updates the settings repository to persist this preference, integrates the parameter into the GeminiProviderImpl request payload, and provides a dropdown UI in the settings screen. The feedback highlights two robustness improvements: using a locale-safe, case-insensitive lookup when parsing the stored service tier to avoid locale-dependent issues with uppercase(), and utilizing safe casting with contentOrNull when extracting the served service tier from the JSON response to prevent potential exceptions.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
- Use case-insensitive ServiceTier.entries lookup instead of locale-dependent uppercase() when reading the stored tier - Safely cast the served service_tier to JsonPrimitive and use contentOrNull to avoid throwing on non-primitive/JsonNull values
What
Adds a selectable Gemini API service tier (Standard or Priority) for the agent's LLM calls.
service_tier: "priority"for lower-latency processing (requires a Tier 2+ billing account).How
ServiceTierenum, persisted via DataStore settings.serviceTierplumbed throughLlmProvider.generateResponseand theAgentOrchestratorinteraction loop.Testing
served (service_tier)=priority.