Repository navigation
Conversation
The auth backend URL was hardcoded to the Cloud Run service, preventing local development setups from using a custom auth endpoint. Now reads from OMI_AUTH_URL env var with fallback to the existing Cloud Run URL. Co-Authored-By: Claude Opus 4.6 <[email protected]>
The Tasks onboarding step was the only step without a Skip option, trapping users if the 'Take me to my tasks' button was unresponsive. Adds an optional onSkip callback consistent with all other steps. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Connects the new onSkip parameter in OnboardingTasksStepView so skipping the tasks step still calls handleOnboardingComplete() and properly initializes all services. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Documents the new configurable auth backend URL for local development. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Greptile SummaryThis PR makes two targeted quality-of-life fixes for the desktop app: it moves the auth backend URL from a hardcoded Cloud Run constant to a runtime-configurable environment variable ( Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[App launches] --> B{Read env var}
B -- "value found" --> C[Normalize trailing slash]
C --> D[Use custom auth URL]
B -- "not set / empty" --> E[Use default Cloud Run URL]
D --> F[AuthService.apiBaseURL ready]
E --> F
F --> G[signIn called]
G --> H[POST to auth backend]
H --> I[Receive OAuth code]
I --> J[Exchange for Firebase credential]
Last reviewed commit: "docs: add OMI_AUTH_U..." |
| private let apiBaseURL: String = { | ||
| if let envURL = getenv("OMI_AUTH_URL") { | ||
| let url = String(cString: envURL) | ||
| if !url.isEmpty { return url.hasSuffix("/") ? url : url + "/" } | ||
| } | ||
| return "https://omi-desktop-auth-208440318997.us-central1.run.app/" | ||
| }() |
There was a problem hiding this comment.
No URL format validation before use
OMI_AUTH_URL is accepted and used without validating that it is a well-formed URL. If a developer accidentally sets the variable to something like localhost:8080 (missing scheme) or omi-auth (a bare hostname), every auth request will fail with a cryptic networking error rather than an early, actionable message.
Consider adding a basic sanity check at initialization time:
| private let apiBaseURL: String = { | |
| if let envURL = getenv("OMI_AUTH_URL") { | |
| let url = String(cString: envURL) | |
| if !url.isEmpty { return url.hasSuffix("/") ? url : url + "/" } | |
| } | |
| return "https://omi-desktop-auth-208440318997.us-central1.run.app/" | |
| }() | |
| private let apiBaseURL: String = { | |
| if let envURL = getenv("OMI_AUTH_URL") { | |
| let raw = String(cString: envURL) | |
| if !raw.isEmpty { | |
| guard raw.hasPrefix("http://") || raw.hasPrefix("https://") else { | |
| fatalError("OMI_AUTH_URL must start with http:// or https://, got: \(raw)") | |
| } | |
| return raw.hasSuffix("/") ? raw : raw + "/" | |
| } | |
| } | |
| return "https://omi-desktop-auth-208440318997.us-central1.run.app/" | |
| }() |
Using fatalError here (or at minimum a loud log/assertion) gives developers an immediate, obvious signal during local setup rather than a silent failure deep in an OAuth flow.
Reorder handleOnboardingComplete() so hasCompletedOnboarding is set BEFORE starting background services. When AgentVMService, ProactiveAssistants, or GoalGeneration fail (e.g. missing API keys, unauthorized), the UI was stuck on the Tasks screen because service errors prevented reaching the state update. Now the UI transitions first and services start after. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Cloud Run OAuth issues tokens for "based-hardware" (prod), but local dev uses "based-hardware-dev" for Firestore. This adds a separate env var FIREBASE_AUTH_PROJECT_ID so auth token validation can target prod while Firestore stays on dev. Falls back to FIREBASE_PROJECT_ID if not set. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Reads auth project from firebase_auth_project_id config, falling back to firebase_project_id, then "based-hardware". This allows auth to validate prod tokens while Firestore accesses the dev database. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
Hey @beastoin 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! 💜 |
Summary
AuthService.swiftauth backend URL was hardcoded to Cloud Run (omi-desktop-auth-*.run.app). Now reads fromOMI_AUTH_URLenv var with fallback to existing URL. This unblocks local development setups.handleOnboardingComplete()so all services (transcription, AgentVM, goals, etc.) are properly initialized.OMI_AUTH_URLto.env.example.Context
Found during local Rust backend setup on Mac Mini — the hardcoded auth URL meant OAuth always went through Cloud Run even when running a local backend. The onboarding dead-end was discovered by ren during app flow exploration.
Test plan
OMI_AUTH_URLset — verify auth redirects to custom URLOMI_AUTH_URL— verify fallback to Cloud Run auth service🤖 Generated with Claude Code