Repository navigation
docs(app): point mobile setup at the local backend harness, not api.omiapi.com - #11532
Conversation
PR BasedHardware#11273 rewired `setup.sh` to build the dev flavor against the local backend harness (Python API on :8000, Firebase Auth emulator on :9099, `demo-omi-local` project), but the setup docs still described the pre-BasedHardware#11273 world. Two defects, both of which land a new contributor in issue BasedHardware#5939: 1. `AppSetup.mdx` told developers to set `API_BASE_URL=https://api.omiapi.com/` "for dev", and claimed the prebuilt Firebase configs cover "Omi's development backend". Firebase ID tokens are project-scoped, and `demo-omi-local` is an emulator-only fake project no hosted backend can verify — so that pairing returns 401 on every authenticated call while sign-in still appears to succeed, exactly the failure BasedHardware#5939 reported, reached through the docs rather than the script. 2. Neither `AppSetup.mdx` nor `app/README.md` told anyone to start the harness. `setup.sh` builds against :8000 and :9099 but starts neither, so the documented path produced connection failures with no explanation. Documentation only — no code or behavior change: - Add a "Start the local backend harness" step (`make dev-init` / `make dev-up`, `PROVIDER_MODE=offline` variant) to the Mintlify guide and `app/README.md`, linking `docs/runbooks/local-emulator-manual-qa.md`. - Name the harness prerequisites the app prerequisites omitted: Python 3.11 (backend/AGENTS.md pins 3.11, not 3.12+), a Java runtime, firebase-tools/npx. - Correct the `API_BASE_URL` row and the prebuilt-Firebase warning; state the project-scoping rule that makes a mismatch fail. - Add troubleshooting entries for both symptoms (connection refused; sign-in succeeds then 401). - Renumber the `app/README.md` quick-setup list for the inserted step. Verification: - `python3.11 .github/scripts/pr_preflight.py --lane local --base main` → "PR preflight passed: 10 checks", files=2 (check-manifest-contract, diff-hygiene, architecture-guardrails, product-invariants, failure-class-protocol, failure-class-guard-artifact-ratchet, desktop-changelog-data, deferred-work-markers, lifecycle-headers, version-prefixed-filenames). Note: plain `make preflight` defaults to `origin/main`. On a fork whose `origin` is stale (mine is 6504 commits behind) that mis-scopes the diff to ~5900 files and selects unrelated lanes; pass `--base main` explicitly. - Cross-checked every command and value against source: `make dev-init`, `dev-up`, `dev-status`, `dev-down` exist in the Makefile; ports 8000/9099 and the `demo-omi-local` project come from `scripts/dev-harness/dev_harness/config.py` and match `app/setup.sh` + `app/lib/env/env.dart`; harness prerequisites match the preflight in `scripts/dev-harness/dev_harness/cli.py`. Not verified: I did not boot the harness or exercise mobile sign-in end to end. This machine cannot run it — `backend/.venv`'s interpreter symlink is dangling (uv's CPython 3.11.15 is gone) and there is no JRE, so `make dev-up` falls back to system Python 3.9 and dies with `ModuleNotFoundError: No module named 'dotenv'`. That failure does confirm the documented ordering (`dev-init` before `dev-up`), but the end-to-end mobile path remains unexercised. Failure-Class: none
There was a problem hiding this comment.
2 issues found across 2 files
Confidence score: 4/5
- In
docs/doc/developer/AppSetup.mdx, the manual setupAPI_BASE_URLguidance useshttp://127.0.0.1:8000/without clarifying platform differences, which can mislead iOS developers and cause avoidable backend-connectivity failures duringflutter run --flavor dev—split the instruction by platform (or call out iOS simulator host mapping explicitly). - In
docs/doc/developer/AppSetup.mdx, the new troubleshooting accordions largely duplicate nearby warnings, increasing the chance of inconsistent edits and making setup guidance harder to scan—deduplicate by keeping one canonical explanation and cross-linking from the other section.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/doc/developer/AppSetup.mdx">
<violation number="1" location="docs/doc/developer/AppSetup.mdx:226">
P3: The manual-setup API_BASE_URL reference now recommends `http://127.0.0.1:8000/` for the local harness, but this manual flow (`flutter run --flavor dev`) targets both platforms and the section does not distinguish iOS from Android. On an Android emulator, `127.0.0.1` is the emulator itself, so manual builds would get connection refused — the new automatic-setup text in this same file explicitly notes Android defaults to `10.0.2.2`. Add the same platform note here so Android users setting up manually don't point at the wrong address.</violation>
<violation number="2" location="docs/doc/developer/AppSetup.mdx:324">
P3: The two new troubleshooting accordions restate, near-verbatim, the two Warnings added in the same PR in the same file. "App can't reach the backend" repeats the Automatic Setup warning (setup.sh doesn't start anything; run `make dev-up`; physical device needs `OMI_DEV_HOST`; Android defaults to 10.0.2.2), and "Sign-in works but every request returns 401" repeats the project-scoping warning above it. Keeping the same guidance in both the inline warnings and the FAQ accordions means a future edit (e.g. a port or project change) has to be updated in four places and will drift. Consider consolidating the accordions to reference the corresponding sections, or trimming the duplication.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| - Verify SHA1/SHA256 keys are added to Firebase | ||
| - Check bundle IDs match your Firebase configuration | ||
| </Accordion> | ||
| <Accordion title="App can't reach the backend (connection refused / timeouts)" icon="plug"> |
There was a problem hiding this comment.
P3: The two new troubleshooting accordions restate, near-verbatim, the two Warnings added in the same PR in the same file. "App can't reach the backend" repeats the Automatic Setup warning (setup.sh doesn't start anything; run make dev-up; physical device needs OMI_DEV_HOST; Android defaults to 10.0.2.2), and "Sign-in works but every request returns 401" repeats the project-scoping warning above it. Keeping the same guidance in both the inline warnings and the FAQ accordions means a future edit (e.g. a port or project change) has to be updated in four places and will drift. Consider consolidating the accordions to reference the corresponding sections, or trimming the duplication.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/doc/developer/AppSetup.mdx, line 324:
<comment>The two new troubleshooting accordions restate, near-verbatim, the two Warnings added in the same PR in the same file. "App can't reach the backend" repeats the Automatic Setup warning (setup.sh doesn't start anything; run `make dev-up`; physical device needs `OMI_DEV_HOST`; Android defaults to 10.0.2.2), and "Sign-in works but every request returns 401" repeats the project-scoping warning above it. Keeping the same guidance in both the inline warnings and the FAQ accordions means a future edit (e.g. a port or project change) has to be updated in four places and will drift. Consider consolidating the accordions to reference the corresponding sections, or trimming the duplication.</comment>
<file context>
@@ -261,6 +321,31 @@ ln -s -f ../../scripts/pre-commit .git/hooks/pre-commit
- Verify SHA1/SHA256 keys are added to Firebase
- Check bundle IDs match your Firebase configuration
</Accordion>
+ <Accordion title="App can't reach the backend (connection refused / timeouts)" icon="plug">
+ `setup.sh` builds against `http://127.0.0.1:8000` but does not start anything.
+ Run `make dev-up` from the repo root first, and confirm with `make dev-status`.
</file context>
| | Key | Description | | ||
| |-----|-------------| | ||
| | `API_BASE_URL` | Your backend URL (use `https://api.omiapi.com/` for dev, or [set up your own](/doc/developer/backend/Backend_Setup)) | | ||
| | `API_BASE_URL` | Your backend URL — `http://127.0.0.1:8000/` for the local harness, or [set up your own](/doc/developer/backend/Backend_Setup) | |
There was a problem hiding this comment.
P3: The manual-setup API_BASE_URL reference now recommends http://127.0.0.1:8000/ for the local harness, but this manual flow (flutter run --flavor dev) targets both platforms and the section does not distinguish iOS from Android. On an Android emulator, 127.0.0.1 is the emulator itself, so manual builds would get connection refused — the new automatic-setup text in this same file explicitly notes Android defaults to 10.0.2.2. Add the same platform note here so Android users setting up manually don't point at the wrong address.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/doc/developer/AppSetup.mdx, line 226:
<comment>The manual-setup API_BASE_URL reference now recommends `http://127.0.0.1:8000/` for the local harness, but this manual flow (`flutter run --flavor dev`) targets both platforms and the section does not distinguish iOS from Android. On an Android emulator, `127.0.0.1` is the emulator itself, so manual builds would get connection refused — the new automatic-setup text in this same file explicitly notes Android defaults to `10.0.2.2`. Add the same platform note here so Android users setting up manually don't point at the wrong address.</comment>
<file context>
@@ -176,12 +223,21 @@ Manual setup gives you full control, allowing you to use your own backend.
| Key | Description |
|-----|-------------|
- | `API_BASE_URL` | Your backend URL (use `https://api.omiapi.com/` for dev, or [set up your own](/doc/developer/backend/Backend_Setup)) |
+ | `API_BASE_URL` | Your backend URL — `http://127.0.0.1:8000/` for the local harness, or [set up your own](/doc/developer/backend/Backend_Setup) |
| `GOOGLE_MAPS_API_KEY` | Optional - for location features |
</file context>
|
Verified this against the codebase and the technical claims all check out — The core fix — documenting that Two minor nits (non-blocking, already surfaced by cubic):
Good documentation contribution. Leaving for human maintainer review for a docs accuracy decision. Automated review by glm-5.2 · Omi PR Maintainer Monitor by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Verified every claim against main: dev-init/dev-up/dev-status/dev-down exist, setup.sh defaults the dev flavor to 127.0.0.1:8000 (10.0.2.2 on Android) and honours OMI_DEV_HOST, api.omiapi.com is the beta profile only, and the demo-omi-local configs are emulator fakes. Docs were stale; this matches the code.
Problem
docs/doc/developer/AppSetup.mdxandapp/README.mdpoint a new mobile developer athttps://api.omiapi.com/, butapp/setup.sh iosconfigures the app for local development: it writesAPI_BASE_URL=http://127.0.0.1:8000/intoapp/.dev.envand passes--dart-define=OMI_FIREBASE_AUTH_EMULATOR_HOST(setup.sh:417-420). The documented target and the actual one disagree.Following the docs as written, a developer gets an app that builds, installs, launches — and then sits on the splash screen, because it is waiting on a backend nobody told them to start. There is no error and no hint of the cause.
Production Firebase makes the documented path worse than useless: the app authenticates against Omi's production Firebase project, and those tokens are rejected on every call, so sign-in appears to succeed and nothing else works.
Change
Documents what
setup.shactually does, and what it does not do:8000and the Firestore emulator — not production.setup.shdoes not start either of them. This prerequisite was previously undocumented and is the single thing most likely to strand a new contributor.127.0.0.1, Android defaults differently. Both are overridable viaOMI_DEV_HOST/OMI_LOCAL_API_BASE_URL.make dev-init) for creatingbackend/.venvand the env template.Verification
Rebased onto current
main; both files have zero upstream commits since the change was written, so it applies cleanly.mainstill contains the staleapi.omiapi.comreference in each file, so the correction is still needed.The splash-screen symptom was reproduced today on an iOS device build:
setup.sh ioscompleted, the app installed and launched, and hung on the logo with nothing listening on port 8000.Scope
Documentation only. It does not change
setup.sh, and deliberately does not try to make the script detect or start the harness — that is a separate change, filed as its own issue.Note that the prod-simulating path (
setup.sh ios beta, which targetshttps://api.omiapi.com/) is gated behindFIREBASE_SERVICE_ACCOUNT_KEYand so is unavailable to community contributors by design. These docs therefore describe the local harness as the supported route rather than implying production is reachable.🤖 Generated with Claude Code
https://claude.ai/code/session_011qmdS9crg5qFhan7PCbWvZ