Repository navigation
Description
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
- Before v0.12 telemetry:
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-backendreturns504forPOST /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
- Inspect the merged timeout fix in [codex] Fix Gemini proxy timeout handling #8640 and confirm the production
desktop-backendrevision includes the intended Rust proxy behavior for non-streaming Gemini calls. - 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).
- 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.
- 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-backendGeminigenerateContent504s 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
- desktop-backend: Gemini proxy generateContent requests time out with 504/502 #8633 — exact prior issue for
desktop-backendGemini proxygenerateContent504/502s; closed 2026-06-29. - [codex] Fix Gemini proxy timeout handling #8640 — merged fix for Gemini proxy timeout handling; current production logs indicate recurrence or incomplete coverage after that fix.
Activity