fix(gemini): derive AI Studio picker controls from model metadata - #111754
jkorzeniak wants to merge 8 commits into
Conversation
SummaryAI Studio-only change: native paginated Gemini model discovery replaces the inherited OpenAI-shape reader, and the effort picker is driven by cached models.dev What changed
Strengths
Findings
VerdictNeeds minor polish (single-entry poisons catalog; verify Off gating end-to-end). Reviewed using Hermes-Agent |
A-061 review follow-up: preserve valid paginated discovery results, document budget sentinels, and cover Off validation through inventory, gateway and request builders.
|
Thanks for the review, @kyssta-exe. Addressed in 1dca4f60c8:
Validation: 280 Python tests passed across 8 files, including 23 catalog/reasoning and 10 gateway tests; Ruff and whitespace checks passed. These were offline checks, with no new live inference calls. The PR description also includes this follow-up. The follow-up code and this response were prepared with OpenAI Codex. |
A-061 audit follow-up: leave budgets unchanged for providers that do not opt into validation, hide auto in TUI status, and report catalog pagination exhaustion without sensitive data.
|
A further audit with Opus running in Hermes identified a TUI regression and an unintended extension of budget validation to other providers. Both were reproduced locally and addressed in 3840f233ef.
Dashboard chat embeds the real TUI, so it receives the same label fix. Its separate React reasoning picker reads saved configuration rather than the changed session-info field. Validation for this follow-up: 236 Python tests across 16 files and 61 TUI tests across 3 files passed, along with TUI typecheck/build, Ruff, ESLint, Prettier and whitespace checks. Six Dashboard helper tests also passed with a minimal Node configuration; the full Dashboard suite was not run because the standard configuration could not load a missing local dependency. No new live inference calls were made. The PR description has been updated with these findings and validation limits. The fixes and this comment were prepared with OpenAI Codex. |
…picker # Conflicts: # hermes_cli/models.py # tests/hermes_cli/test_provider_live_curated_merge.py
What changes
Google AI Studio now lists models from Google's native paginated
models[].namecatalog with header authentication. A successful listing, including an empty one, replaces curated IDs; failed or partial discovery retains fallback behavior. Malformed individual entries are skipped, and dedicated Computer Use routes are excluded from the generic agent picker.Thinking controls come from cached models.dev
reasoning_options. Desktop and the request builder use the same metadata for supported levels, bounded token budgets, Dynamic, and Off. Unsupported explicit choices are rejected before mutation; inherited settings are normalized. Unknown metadata leaves the override unset instead of advertising an unverified ladder. Unset, Dynamic, and Off remain distinct.This is scoped to AI Studio; it does not include the separate Antigravity integration or change Vertex's thinking policy. Provider validation is opt-in.
Compatibility with current main
Updated through upstream
e6bb65aa2fc895224dcdcfc3802fa26d87e2134f, preserving the existing branch history.clamp_reasoning_config, provider capability metadata, OAuth extension hooks, and account-usage hook.Validation
Native Windows, Python 3.11, Node 22.23.2; isolated checkouts with their own dependencies.
fe32647090: 259 Python tests across 22 files viascripts/run_tests.sh; 35 Desktop tests across 4 files; full Desktop TypeScript checks passed.7c4d2a812eand setup regression fix: 39 Python tests across 4 files passed, including native catalog controls, authoritative setup behavior, and external-process provider initialization.e6bb65aa2f: 50 Python tests across 5 files passed, covering Gemini controls, authoritative setup catalogs, OpenCode retired-model filtering, and generated contracts. Ruff and whitespace checks passed on the two conflict resolutions.No new live inference calls or full repository suite were run for this update. Prior live observations are not a benchmark of this revision.
Focused reproduction:
scripts/run_tests.sh tests/agent/test_gemini_catalog_reasoning.py tests/tui_gateway/test_gemini_reasoning_controls.py tests/hermes_cli/test_provider_live_curated_merge.py tests/hermes_cli/test_setup_provider_catalog.py tests/tui_gateway/contracts/test_generated.py npm run typecheck --workspace apps/desktop npm run test --workspace apps/desktop -- src/app/shell/model-edit-submenu.test.tsx src/app/shell/model-catalog-menu.test.tsx src/lib/reasoning-effort.test.ts src/app/chat/composer/reasoning-pill.test.tsxLimits and related work
models.dev metadata may be incomplete or stale; discovery does not make generation probes, and catalog membership does not guarantee account access or quota. Fast is not advertised for AI Studio. Validated reasoning edits during a running turn remain guarded.
Discovery overlaps with #42693 and #62267; retired-ID cleanup with #109896. Earlier closed proposals #85246 and #90801 addressed metadata-driven effort menus. This PR connects AI Studio discovery, controls, validation and request serialization.
AI assistance: OpenAI Codex assisted with investigation, implementation, tests, and this description. Human input defined scope and interaction requirements. Automated checks do not imply exhaustive human review.