Repository navigation
feat: Gemini media-v1 wire plans, retry guards and safe diagnostics - #65
Brian Krabach (bkrabach) wants to merge 5 commits into
Conversation
Advertised-model offline wire coverage follow-upTest-only follow-up closes the review gap for the already-advertised Exact follow-up head:
The 8-case model/MIME/transport matrix uses actual The 4 additional Flash fixtures use the real SessionMediaStore/capability/projector from immutable archived Foundation candidate Verification uses both provider key variables unset and a socket.connect/connect_ex refusal installed before pytest/provider imports, in addition to the maintained autouse fence. No inference, live credentials/config changes or DTU occurred.
Prior failed/inadvertent-live incident evidence remains retained and unchanged. No runtime fixes or blanket capability-tag changes were made for this coverage repair. Parent exact-head Astra/Fable review, accepted F1/L1 graph integration and integration-owned qualification remain holds; PR stays draft. |
Full documented model catalogue correction (offline candidate)Public Google documentation audited 2026-11-14 confirms the old two-ID allowlist was incomplete: it omitted even the provider's configured Final head Model/position matrix
Important limits retained
Offline verificationKeys unset and socket.connect/connect_ex refused before pytest/provider imports, plus maintained autouse fence. Existing isolated deps: Core1.6.1, google-genai2.30.1, HTTPX0.28.1, Pillow12.3.0. No installs, credentialed API listing, inference, config changes, DTU or activation.
Parent exact-head Astra/Fable review, accepted dependency graph/host integration and integration-owned installed qualification remain holds. PR stays draft; no merge or release. |
Summary
Implement frozen P1 Gemini media-v1 projection: exact documented model/position facts, original-position user
inline_dataand call-boundfunctionResponse.parts, private count/send plan identity, per-attempt media validation and pre-emit pixel-safe diagnostics. Runtime imports Core only: no Core changes or Foundation/app/peer-SDK helper imports. No host activation.The initial two-model allowlist was incomplete. The current catalogue follows public vendor evidence audited 2026-11-14, including the configured
gemini-3.8-flashdefault. Exact per-model URLs, modality quotations, tool scope and route/availability caveats are in contracts/gemini-media-evidence.v1.json. Unknown positions are not qualified for this route, not asserted vendor-incapable.Exact source and dependency holds
Base: accepted main
e040c7cee5561c0b5b2df66a3dc8ac8cd2a4e043, not an unrelated local provenance branch.DRAFT / DO NOT MERGE: parent106 final exact-head Astra/Fable review and integration against accepted F1/L1/host dependencies remain required. Offline pairing uses immutable archived Foundation candidate 31766b42efe71920386975cf10d136b38b85fc14, not a moving dirty checkout and not an accepted-graph claim. No DTU launch, credentialed model catalogue, live inference qualification, merge, release or live adoption is performed here. Integration owns the later accepted graph/installed qualification.
Structural seam:
get_media_request_support(*,model,request_options=None)returns v1 positions/mime_types/evidence and optional reason.cap.validate(exact_private_request,purpose='count'|'transport',request_options=effective_options)gates every real attempt. Any cap-present request needs its host-owned private association, including text-only/unavailable projections. No witness marker or hydration is added to canonical metadata/history/suspension.Current support matrix — offline wire, not entitlement/live vision
PNG/JPEG only under the frozen producer scope. Exact enumerated IDs, never a runtime prefix guess or automatic local model switch:
gemini-3.8-flash,gemini-3.7-flash,gemini-3.6-flash,gemini-3.5-flash,gemini-3.5-flash-lite,gemini-3.1-flash-lite,gemini-3.1-pro-preview,gemini-3.1-pro-preview-customtools,gemini-3-flash-previewgemini-4-hydrogengemini-4-carbon,gemini-4-argon,gemini-robotics-er-2-previewgemini-2.5-pro,gemini-2.5-flash,gemini-2.5-flash-liteThis is 16 user-image / 10 tool-image IDs.
get_infoandlist_modelsvision tags use the same exact catalogue. System/developer/assistant images remain unqualified. No synthetic user image turn is added. Specialized image-generation models can genuinely accept images but have different output/function-calling contracts; Live, TTS, embedding, managed-agent, Decisions and video-output APIs are distinct. Existing specialized image-operation code is unchanged. No blanket Gemini-family capability claim.Vendor routing notices (
3.7-flashto3.8-flash,3.5-flashto3.6-flash) and 2.5 existing-user restrictions/future December 1 routing are disclosed, not implemented locally.Limits versus native measurement
Robotics standard ER2's exact public input/output facts are 131,072 / 65,536 tokens.
get_info().defaults.context_windownow publishes 131,072 rather than inheriting the unknown-model 1,048,576 fallback. Publication-only exact facts are separate from native-counter qualification; the separate Live endpoint and guessed Robotics suffixes do not inherit them.Native budget counting remains unavailable for the three Gemini 4 IDs and Robotics ER2. Gemini 4 unified-window semantics are not guessed or changed. Tests distinguish actual mocked HTTP count on the previously qualified 3.x/2.5 set from wire-projection parity only on 4/Robotics; no fake provider_count or borrowed measured-fit claim.
Identity, retry, metadata and privacy
A weak request-scoped vendor plan binds the exact candidate/options/selected connection; SDK calls receive copies. Native signatures, provenance and call pairing are retained. Finalization tool_choice=none stays NONE. Host/loop single-refit remains authoritative; no new refit loop, compact_context or public iterator stream method is fabricated.
completeowns the existing internal streaming transport.Qualified media requests disable SDK/aiohttp inner retries, AFC, redirects and unqualified HTTP auth/request hooks/retrying transports without mutating the shared client. Received transient failures revalidate before retry; unknown sends, timeouts and partial streams do not automatically replay. Completion/error/cancellation/count failure/session close release provider-owned cache state.
Diagnostic COPY projection occurs before hooks.emit. Known image transports are omitted with explicit not-retained markers, not fabricated resolvable refs or raw-base64 fallbacks. Legacy-image retry/error diagnostics are protected too. No diagnostic ingest/publish or new canonical retention authority is added.
Verification and review
Existing isolated dependencies: Core1.6.1, google-genai2.30.1, HTTPX0.28.1, Pillow12.3.0. No manifest/lock changes. Both provider keys unset; real socket connects refused before pytest/provider imports, plus maintained autouse offline fence.
66f92628.../ final evidence wording264b59ae...: 187 focused passes paired with immutable F1 candidate31766. Matrix: 64 valid PNG/JPEG user complete/SSE cases, 40 tool cases, 64 actual F1 canonical-to-private cases plus prior guards. Every literal declared model is covered by actual SDK MockTransport, decoded original bytes/SHA/order/MIME/options/privacy; warnings are frozen at the original call-bound block before count.Retained failures / scope incident
The Robotics regression was first demonstrated failing (1048576 !=131072); failure log retained. Earlier catalogue run had one stale 3.8 no-vision expectation failure, corrected from exact documentation; prior valid-pixel assertions initially used standard rather than the SDK's URL-safe strict base64 alphabet, corrected while preserving exact original byte equality. Failed logs remain retained, not converted to passes.
An earlier initial focused command accidentally omitted the live-test exclusion and ran the existing real-API image test with an inherited credential; it failed, was disclosed, never repeated or used as qualification. Subsequent checks unset both keys, exclude live tests and enforce the pre-import socket fence. Initial wire-alias/Mock diagnostic-recursion failures and timeout/termination logs are retained. No later inference campaign is implied.
Evidence and cleanup
Task-owned untracked working-files retains exact result packets, sanitized actual-wire XML/JSON with decoded SHA/order, source/dependency joins, baseline/current/failure logs and immutable F1 archive. Source checkout and isolated .venv remain intentionally available for parent integration. No containers, DTUs or remote runtimes created; no unrelated teardown, automatic cleanup or live activation claimed.