Skip to content

desktop-backend Gemini proxy returns persistent 504s while /health stays green #9135

Closed

Description

@Git-on-my-level

Summary

Production desktop-backend is returning persistent gateway timeouts on the Gemini proxy endpoint while /health remains green.

This is a capability-specific prod degradation: public liveness checks pass, but a real desktop AI path is failing repeatedly.

Evidence

Observed during read-only prod health checks on 2026-07-06 UTC:

  • Public health endpoints all returned 200:
    • https://api.omi.me/v1/health
    • https://api.omiapi.com/v1/health
    • https://agent.omi.me/health
    • https://agent.omiapi.com/health
  • desktop-backend Cloud Logging errors:
    • last 10m: 13x 504 on /v1/proxy/gemini/models/gemini-2.5-flash:generateContent
    • last 30m: 37x 504 on the same endpoint
    • last 2h: 151x 504 on the same endpoint
  • Related but separate noise in the same service:
    • last 2h: 24x 500 on /v1/webhooks/sentry/poll
    • last 2h: 1x 503 on /v1/tts/synthesize

PostHog guardrails showed chat completions still happening, so this does not look like a total chat outage, but the Gemini proxy path is actively degraded.

Expected behavior

The desktop Gemini proxy should either succeed or return a bounded, typed error that distinguishes:

  • upstream timeout
  • upstream rate limit / quota
  • auth / BYOK failure
  • client cancellation
  • internal proxy failure

It should not repeatedly surface as generic gateway timeouts without a capability-level alert.

Acceptance criteria

  • Add/log structured error classification for Gemini proxy failures.
  • Add a metric/dashboard/alert for desktop Gemini proxy 5xx/504 rate.
  • Add a synthetic or capability health check for Gemini proxy behavior, separate from /health.
  • Return a bounded, typed user-facing failure where possible instead of an opaque gateway timeout.
  • Confirm the fix with Cloud Logging showing the Gemini proxy 504 bucket dropping to near-zero over a comparable window.

Priority

P1: current prod capability degradation that /health does not catch.

Activity

  1. added
    bug
    backend
    p1
    on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbugdesktopp1reliability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions