fix(desktop-backend): admit the gateway route in the candidate probe - #12374
Merged
Conversation
#12337 routed company-paid desktop Gemini traffic through the LLM gateway; since then the desktop proxy stamps X-Omi-Provider: llm_gateway (backend/utils/llm/desktop_gemini_gateway.py), a value the Auto Deploy candidate probe's REAL_GEMINI_PROVIDER_ROUTES did not admit, so "Prove candidate chat compatibility" fail-closed on every promotion (run 33219770852) and dev desktop-backend stayed on the stale revision. Admit llm_gateway: the probed surface (gemini-2.5-flash generateContent) maps to the gateway's desktop-vertex-flash lane, whose primary provider is VertexGeminiProvider with no fallbacks (config_loader.py), so the hop is real Gemini-on-Vertex. Stubs, unknown, and empty routes stay rejected fail-closed; the offline-stub rejection test is unchanged and a new test pins the post-gateway route as admitted end to end through _gemini_request. Verification: python3 .github/scripts/test_desktop_backend_candidate_probe.py 19 tests OK (incl. test_gemini_probe_admits_post_gateway_llm_gateway_route). Failure-Class: FC-client-model-outside-proxy-allowlist Co-authored-by: multica-agent <github@multica.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Auto Deploy Desktop Backend to Development promotion gate fail-closed on every candidate since #12337: the probe's
REAL_GEMINI_PROVIDER_ROUTESdid not admit thellm_gatewayprovider route the desktop proxy now stamps onX-Omi-Providerfor company-paid Gemini traffic (run 33219770852, step "Prove candidate chat compatibility",gemini_proxy: response did not come from an admitted provider route). Dev stayed 100% on the stale revisiondesktop-backend-cdca0c865fd1-33169706190-1; the candidate was correctly held tag-only.This PR admits the real post-gateway route in the probe allowlist. No backend behavior changes.
Why this is a real route, not a weakened gate
The probed surface is
POST /v1/proxy/gemini/models/gemini-2.5-flash:generateContent. Post-#12337, that request hops the gateway:backend/routers/desktop_proxy.py→company_paid_via_gateway→proxy_company_paid_via_gatewaystampstelemetry.provider = 'llm_gateway'→X-Omi-Provider: llm_gateway(backend/utils/llm/desktop_gemini_gateway.py:595).gemini-2.5-flashmaps to laneomi:auto:desktop-vertex-flash(utils/llm/vertex_pt_routing.pyDESKTOP_TEXT_LANES), whose route pins primary providergemini=VertexGeminiProviderwith no fallbacks (backend/llm_gateway/gateway/config_loader.py:330) — real Gemini-on-Vertex.offline_stub,desktop_llm_stub, unknown, and empty header values remain rejected fail-closed; the existing offline-stub rejection test is unchanged.Test plan
python3 .github/scripts/test_desktop_backend_candidate_probe.py— 19 tests OK locally, including:test_gemini_probe_rejects_stub_or_unknown_provider_routes: rejectsoffline_stub/desktop_llm_stub/unknown/"", admitsvertex_ai/ai_studio/ai_studio_byok;test_gemini_probe_admits_post_gateway_llm_gateway_route: a gateway-served response (x-omi-provider: llm_gateway) passes_gemini_requestend to end and reportsprovider_route: llm_gateway— the exact live failure mode, now pinned as passing.gcloud run services describe desktop-backend --project=based-hardware-dev --region=us-central1is the independent serving proof (tracked on SCA-368).Product invariants
none (per
scripts/pr-preflight --suggest)Failure-Class
Failure-Class: FC-client-model-outside-proxy-allowlist
#12337 retargeted the desktop proxy at a new provider route without widening the gate that admits it in the same change, so the promotion gate rejected a value it did not know instead of degrading. This PR widens the admission set in data and pins both directions (real route admitted, stub class still rejected) in the probe's test file.