Skip to content

Regression: desktop-backend Gemini proxy generateContent still returns 504s after v0.12 #8906

Closed

Description

@Git-on-my-level

Summary

Production desktop-backend is still returning high-volume 504s for Gemini non-streaming proxy calls after the v0.12 prod release, despite the earlier timeout-handling fix in #8640 / #8633.

This appears to be the main post-release backend error regression: the v0.12 desktop build itself has clean crash/sign-in/chat-agent-error signals so far, but Cloud Run request logs show POST /v1/proxy/gemini/models/gemini-2.5-flash:generateContent timing out at roughly the configured upstream deadline / platform boundary.

Evidence

Sanitized observability sweep run: 2026-07-03 UTC.

Sources:

  • Cloud Logging project: prod based-hardware
  • Service: Cloud Run desktop-backend
  • Endpoint bucket: POST /v1/proxy/gemini/models/gemini-2.5-flash:generateContent
  • v0.12 first prod macOS telemetry cutoff: 2026-07-03T06:35:18Z
  • Equal comparison windows:
    • Before v0.12 telemetry: 2026-07-03T05:40:18Z–2026-07-03T06:35:18Z
    • After v0.12 telemetry: 2026-07-03T06:35:18Z–2026-07-03T07:30:18Z

Cloud Run 5xx before/after

Window Total Cloud Run 5xx desktop-backend Gemini proxy 504s Notes
Before v0.12 73 27 Other backend memory 503s were also present.
After v0.12 58 44 Overall 5xx down, but Gemini proxy 504s increased and dominate post-window errors.

Representative sanitized shape:

  • desktop-backend returns 504 for POST /v1/proxy/gemini/models/gemini-2.5-flash:generateContent
  • sampled request latency around 120s
  • no request/response bodies, user IDs, IPs, tokens, or provider payloads included here

Related product metrics context

PostHog prod macOS v0.12 build 12000 during the post window:

Signal v0.12 build 12000
App Launched 192 events / 182 users
Phone Mic Recording Error 0
chat_agent_error 0
Sign In Failed 0
App Crash Detected 0

So this is not currently evidence of a broad v0.12 app crash/sign-in regression; it is a backend proxy reliability bucket that can still cause failed/stuck desktop AI/chat operations.

Suggested investigation / fix direction

  1. Inspect the merged timeout fix in [codex] Fix Gemini proxy timeout handling #8640 and confirm the production desktop-backend revision includes the intended Rust proxy behavior for non-streaming Gemini calls.
  2. Determine whether these 504s are now intentionally mapped upstream timeouts (good: sanitized response before Cloud Run kills the request) or still platform-level Cloud Run gateway timeouts (bad: proxy not owning the deadline consistently).
  3. Add/verify aggregate logging for provider/model/action/status/duration bucket so future sweeps can distinguish:
    • upstream Gemini deadline exceeded,
    • Cloud Run request deadline,
    • client disconnect/body read timeout,
    • proxy/internal errors.
  4. Consider lowering the non-streaming upstream timeout below the Cloud Run/request boundary, adding fallback/error UX for generateContent, or routing long multimodal requests through a job/streaming path if expected to exceed the sync deadline.

Acceptance criteria

  • Fresh prod sweep over an equivalent post-release window shows desktop-backend Gemini generateContent 504s reduced materially from the current bucket.
  • Timeout responses are proxy-owned, sanitized, and observable with provider/model/action/duration/status buckets.
  • Desktop receives a clear recoverable error quickly enough to avoid stuck long waits.
  • No raw prompts, transcripts, tokens, user IDs, request bodies, or provider responses are logged.

Related existing issues / PRs checked

Activity

  1. added
    bug
    chat
    backend
    intelligence
    p1
    on Jul 3, 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

    backendbugchatdesktopintelligencemacOSp1reliability

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions