-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Problem
The desktop macOS app uses a dedicated Rust backend (desktop/Backend-Rust/, deployed as desktop-backend on Cloud Run) with 80+ endpoints that largely duplicate the Python backend's 339+ endpoints at api.omi.me. This creates dual maintenance, separate deployments, and has caused bugs (#5296 stale download).
Python backend is the source of truth. Swift app adapts to Python's existing contracts. Rust-only features get ported to Python or dropped.
Scope
Auth is NOT in scope — desktop auth (omi-desktop-auth Cloud Run) is separate.
Current Status
Already Migrated
- Sparkle auto-updates — PR Consolidate desktop updates: Python-only appcast with beta/stable channels #5304
- Download endpoint — Python
/v2/desktop/download/latest - Release registration — GitHub metadata
- Channel switch UX — PR Desktop: auto-check updates on channel switch + downgrade confirmation #5314
- Dev environment — PRs Add dev auto-deploy for Rust desktop backend #5310, Make GCE project configurable for AgentVM provisioning #5349, Use dedicated omi-agent-vm firewall tag for AgentVM instances #5353, Add .env.example templates for desktop app and Rust backend #5357
Verified Endpoint Audit
- ~65 endpoints: no work needed — direct Python equivalents exist
- 11 PRs needed — see 3-day plan below
- 4 features dropped for cutover (Crisp, LLM usage, stats, Sentry)
3-Day Migration Plan (v4)
Chat Strategy: Option A — Python CRUD compat
Add desktop-compat CRUD endpoints in Python matching Rust's message contract. Python streaming RAG untouched for mobile/web. Swift changes = zero for chat. Full ChatEngine rewrite is follow-up optimization.
Day 1: Unblock Critical Contracts (5 PRs parallel)
- PR1: Python chat CRUD compat (
/v2/desktop/messages) - PR2: Python chat sessions CRUD (
/v2/chat-sessions) - PR3: Python screen activity sync (
POST /v1/screen-activity/sync) - PR4: Swift decoder fixes (action_items key, optional fields, agent VM paths)
- PR5: Router wiring in
backend/main.py
Day 2: Port Remaining Gaps (5 PRs parallel)
- PR6: Python focus sessions + stats
- PR7: Python daily score + scores
- PR8: Python AI profile + assistant settings
- PR9: Python advice CRUD
- PR10: Python staged tasks + promote logic (largest)
Day 3: Integration + Hardening + Cutover
- PR11: Final compat fixes + edge cases
- Full test pass (
backend/test.sh) - Desktop smoke suite against Python backend
- Cutover:
OMI_API_URL→api.omi.me - Rust backend hot as rollback for 72h
Critical Path
PR1 (chat) + PR2 (sessions) → PR5 (wiring) → Day 3 integration
PR10 (staged tasks) → Day 3 integration
PR4 (Swift decoders) → Day 3 smoke test
Decision Gate
Day 2 noon: if chat compat is unstable → switch to Option B (keep Rust for chat only, migrate everything else).
Swift Must Adapt
| Mismatch | Rust | Python | Fix |
|---|---|---|---|
| Action items key | "items" |
"action_items" |
Swift CodingKeys |
| Agent VM paths | /v2/agent/* |
/v1/agent/vm-* |
Swift URL map |
| Memory optional fields | Required | Optional | Swift defaults |
| Conversation timestamps | Required | Optional | Swift optional |
Rollback
- Rust backend stays hot for 72h+ after cutover
- Instant rollback via
OMI_API_URLenv var change - All Python changes are additive — no destructive schema changes
Related
- macos.omi.me serves stale DMG — Codemagic missing isLive metadata, Python download endpoint bypassed #5296, Consolidate desktop updates: Python-only appcast with beta/stable channels #5304, Desktop: auto-check updates on channel switch + downgrade confirmation #5314, Make GCE project configurable for AgentVM provisioning #5349, Use dedicated omi-agent-vm firewall tag for AgentVM instances #5353, Add .env.example templates for desktop app and Rust backend #5357
Full analysis in comments below.