Skip to content

fix(desktop-backend): admit the gateway route in the candidate probe - #12374

Merged
Git-on-my-level merged 1 commit into
mainfrom
sca-368-admit-gateway-route
Aug 28, 2026
Merged

fix(desktop-backend): admit the gateway route in the candidate probe#12374
Git-on-my-level merged 1 commit into
mainfrom
sca-368-admit-gateway-route

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

What

The Auto Deploy Desktop Backend to Development promotion gate fail-closed on every candidate since #12337: the probe's REAL_GEMINI_PROVIDER_ROUTES did not admit the llm_gateway provider route the desktop proxy now stamps on X-Omi-Provider for 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 revision desktop-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.pycompany_paid_via_gatewayproxy_company_paid_via_gateway stamps telemetry.provider = 'llm_gateway'X-Omi-Provider: llm_gateway (backend/utils/llm/desktop_gemini_gateway.py:595).
  • gemini-2.5-flash maps to lane omi:auto:desktop-vertex-flash (utils/llm/vertex_pt_routing.py DESKTOP_TEXT_LANES), whose route pins primary provider gemini = VertexGeminiProvider with 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:
    • updated test_gemini_probe_rejects_stub_or_unknown_provider_routes: rejects offline_stub / desktop_llm_stub / unknown / "", admits vertex_ai / ai_studio / ai_studio_byok;
    • new test_gemini_probe_admits_post_gateway_llm_gateway_route: a gateway-served response (x-omi-provider: llm_gateway) passes _gemini_request end to end and reports provider_route: llm_gateway — the exact live failure mode, now pinned as passing.
  • After merge: Auto Deploy Desktop Backend to Development must build, probe, and shift 100% dev traffic to the merge-SHA revision; gcloud run services describe desktop-backend --project=based-hardware-dev --region=us-central1 is 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.

Review in cubic

#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>
@Git-on-my-level
Git-on-my-level merged commit ecec0c2 into main Aug 28, 2026
31 checks passed
@Git-on-my-level
Git-on-my-level deleted the sca-368-admit-gateway-route branch August 28, 2026 23:42
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.

1 participant