Skip to content

docs(app): point mobile setup at the local backend harness, not api.omiapi.com - #11532

Merged
kodjima33 merged 1 commit into
BasedHardware:mainfrom
formed2forge:fix/mobile-setup-docs-local-harness
Aug 14, 2026
Merged

kodjima33 merged 1 commit into
BasedHardware:mainfrom
formed2forge:fix/mobile-setup-docs-local-harness

Conversation

@formed2forge

@formed2forge formed2forge commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Problem

docs/doc/developer/AppSetup.mdx and app/README.md point a new mobile developer at https://api.omiapi.com/, but app/setup.sh ios configures the app for local development: it writes API_BASE_URL=http://127.0.0.1:8000/ into app/.dev.env and 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.sh actually does, and what it does not do:

  • The build targets the local backend harness — the Python API on port 8000 and the Firestore emulator — not production.
  • setup.sh does not start either of them. This prerequisite was previously undocumented and is the single thing most likely to strand a new contributor.
  • Its real prerequisites: Python 3.11 (not 3.12+ — the backend pins 3.11) and a Java runtime for the Firestore emulator.
  • Addressing differs by platform: iOS reaches the harness at 127.0.0.1, Android defaults differently. Both are overridable via OMI_DEV_HOST / OMI_LOCAL_API_BASE_URL.
  • A one-command path (make dev-init) for creating backend/.venv and the env template.

Verification

Rebased onto current main; both files have zero upstream commits since the change was written, so it applies cleanly. main still contains the stale api.omiapi.com reference in each file, so the correction is still needed.

The splash-screen symptom was reproduced today on an iOS device build: setup.sh ios completed, 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 targets https://api.omiapi.com/) is gated behind FIREBASE_SERVICE_ACCOUNT_KEY and 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

Review in cubic

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 2 files

Confidence score: 4/5

  • In docs/doc/developer/AppSetup.mdx, the manual setup API_BASE_URL guidance uses http://127.0.0.1:8000/ without clarifying platform differences, which can mislead iOS developers and cause avoidable backend-connectivity failures during flutter 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">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@Git-on-my-level Git-on-my-level added the docs-tooling Layer: Documentation, examples, dev tools label Aug 14, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member

Verified this against the codebase and the technical claims all check out — setup.sh does write API_BASE_URL=http://127.0.0.1:8000/ and sets OMI_FIREBASE_AUTH_EMULATOR_HOST, the make dev-init/dev-up/dev-status/dev-down targets all exist, PROVIDER_MODE=offline is valid (providers.py), the Auth emulator port 9099 matches config.py and env.dart, the demo-omi-local project matches firebase_options_local.dart, and the Python 3.11 pin matches backend/.python-version. The linked runbook docs/runbooks/local-emulator-manual-qa.md exists.

The core fix — documenting that setup.sh does not start the backend/emulator and that make dev-up must be run first — addresses a real onboarding gap (the splash-screen hang the PR describes). The warnings about not pointing at api.omiapi.com with emulator-only Firebase configs are technically accurate given the project-scoping behavior.

Two minor nits (non-blocking, already surfaced by cubic):

  • AppSetup.mdx manual-setup table: the API_BASE_URL row now recommends http://127.0.0.1:8000/ but doesn't distinguish iOS (127.0.0.1) from Android emulator (10.0.2.2), while the automatic-setup section above does. An Android developer following manual setup would hit connection-refused. A one-line platform note would match the automatic section's precision.
  • Troubleshooting accordions largely restate the inline <Warning> blocks in the same file. Consolidating or cross-linking would reduce drift risk if ports/projects change.

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 need human response.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kodjima33
kodjima33 merged commit 5dfc372 into BasedHardware:main Aug 14, 2026
34 checks passed
@cursor
cursor Bot deleted the fix/mobile-setup-docs-local-harness branch September 2, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-tooling Layer: Documentation, examples, dev tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants