Skip to content

Canonical Gemini model listing with strict discovery and explicit filters - #63

Merged
Brian Krabach (bkrabach) merged 3 commits into
mainfrom
feat/strict-model-discovery
Nov 7, 2026
Merged

Brian Krabach (bkrabach) merged 3 commits into
mainfrom
feat/strict-model-discovery

Conversation

@bkrabach

@bkrabach Brian Krabach (bkrabach) commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Canonical model-list contract

Normal successor to the strict-discovery candidate at e4b6d83. The unshipped parallel discover_models() method is removed; its strict all-page SDK transport now backs async list_models(*, filters=None) -> list[ModelInfo].

  • No argument / None uses frozen configured model_filters. Every explicit mapping REPLACES defaults: {} is unfiltered, include=[] returns none, exclusions win, glob matching is case-insensitive and OS-independent. Existing selectable ID spelling/resource scopes are preserved (the pre-existing Developer models/ normalization remains).
  • Advertised defaults include all active policy: include=["*"], exclude=[], hide_dated=true, chat_only=true, latest_per_tier=true. Select newest numeric Gemini Pro/Flash/Flash-Lite in each resource scope, plus a strictly newer preview. Prefer matching aliases over snapshots. Unknown families/suffixes remain in the unfiltered view. No invented Pro or other model ID.
  • Reported generation methods govern chat eligibility when present. When omitted (including Vertex publisher metadata), recognize ordinary chat names conservatively, without treating names as capability evidence. Media-only names are omitted from defaults. Only actual thinking / streamGenerateContent metadata becomes capabilities. Missing Core-required integer limits are 0 (documented unknown sentinel), not invented inference limits; listing defaults are empty.
  • Fresh optional get_model_list_info() v1 metadata advertises source, filters_keyword, filters_schema, default_filters, unfiltered, and override. No Core or Foundation dependency/change.

Preserved safety and inference

Every page is validated before local filtering, including include=[]. Genuine empty arrays and valid omitted ProtoJSON repeated collections remain successful; wrong-type/null/error/unrelated payloads and later-page failures remain errors, never partial success. Existing API-key/custom-endpoint/Vertex route ownership, cancellation, retry behavior and no-cache/no-static-fallback rules remain. Errors and retry events are sanitized. Image selection is separate.

Exact explicitly selected hidden models still generate with the same model, effort, temperature, output limit and extra request parameters. Listing is neither an inference allow-list nor proof of account entitlement.

The locked SDK 2.30.1 exposes a native filter string, but equivalent common Developer/Vertex latest-tier/alias/glob semantics are not established. This change sends no speculative native filter: one complete list (plus required pagination) is filtered locally.

Current evidence

Head: 6669ea5a15affe6ab9ed9b4ef31b36a595b5c282
Tree: f7c8a855e67f696c78a1efb5e294106a5e6ef55d

  • Managed offline python-project qualification with locked google-genai==2.30.1, amplifier-core==1.6.1, httpx==0.28.1. Real SDK MockTransport checks, no live provider calls or credentials.
  • 399 focused source tests passed, including defaults/custom/unfiltered/empty/exclude/case, frozen config and in-flight mutation, aliases/snapshots/tiers/previews, empty/malformed/all-page parsing, account/endpoint/Vertex isolation, cancellation/errors/retries, and exact hidden-model inference wire equality. Existing configuration, effort, request-parameter, close and image-client ownership tests included.
  • 399 focused installed-wheel tests passed outside the source tree, with no /workspace entry in sys.path; import origin asserted in a separate temporary virtual environment. Every packaged module's source bytes == wheel bytes == installed bytes. Ruff passed for selectors and changed listing tests.
  • Wheel SHA-256: 4ec85551f9fede673839d4a45f12649acacdff0281773379913b727e786bff1c. Built from tree 08c6a2ccec7b3c70306df4ce9bcfe505860f5c3b; all runtime source bytes match final head. The successor changes only the behavioral test harness.
  • 231 managed focused checks passed on the final tree, including the corrected inherited behavioral/structural contracts plus listing policy, parser and retry checks. The final snapshot tree equals the committed tree above.
  • Current CI: Python 3.11 and 3.12 both 875 passed, 1 live test deselected; CLA passed. Existing warnings remain (40 / 39).
  • Original failed setup checks retained: preflight JSON-schema inspection encountered SDK arbitrary-type schema support; corrected signature inspection passed. First wheel-install attempt found prepared dependencies read-only; the corrected run used a writable guest-local virtual environment and passed. Neither failed run is presented as green.
  • First CI at 06c30d8 failed both minors solely because the inherited offline behavioral test still mocked the former SDK pager. Its stale mock allowed a discovery GET using its forced nonfunctional placeholder key to reach the live endpoint and fail; no inference ran. This unintended request is explicitly retained, not covered by the managed-run offline claim. The successor binds that test to the real SDK MockTransport and checks the request count. No test is skipped to hide the failure.

Controlled fixture example, not an entitlement assertion: returned Pro2.5, Flash3.7/3.8, Flash-Lite3.5, Flash3.9-preview and an image preview yield Pro2.5, Flash3.8, Flash-Lite3.5 and Flash3.9-preview. No returned Pro means no Pro recommendation.

Retained earlier evidence

The original e4b6d83 candidate's 206 focused / 831 offline suite / 175 wheel-discovery results and its earlier ProtoJSON correction history remain attributable only to that original source. Current changed-risk evidence above supersedes its discovery-interface assertions; no old full-suite result is claimed for the new head.

Parent owns independent acceptance and merge. No merge, release, live adoption, force-push, recursive workers, Core changes, Foundation dependency or other repository edits.

@bkrabach Brian Krabach (bkrabach) changed the title Add strict fresh API model discovery with complete pagination Canonical Gemini model listing with strict discovery and explicit filters Nov 6, 2026
@bkrabach
Brian Krabach (bkrabach) merged commit d1eae1a into main Nov 7, 2026
3 checks passed
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.

2 participants