Skip to content

fix: offline-harness STT stub + keyless-geocode guard so offline sessions complete end-to-end - #14485

Merged
Git-on-my-level merged 2 commits into
mainfrom
fix/offline-stt-stub-and-geocode-guard
Sep 18, 2026
Merged

Git-on-my-level merged 2 commits into
mainfrom
fix/offline-stt-stub-and-geocode-guard

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Physical-device qualification on the offline harness (SCA-491/C5) found that uploaded phone captures dead-end: offline stages strip provider secrets by design, so pre-recorded STT fails with PrerecordedSTTConfigurationError (provider parakeet, HOSTED_PARAKEET_API_URL absent) and the sync job finalizes failed/config_error — the conversation is created server-side but never completes, and the app shows "Waiting for transcript…" forever (receipted in the workspace run record).

  • Deterministic offline STT stub (backend/utils/stt/prerecorded_stub.py), mirroring the existing OMI_LLM_STUB pattern: selected in get_prerecorded_provider only when OMI_STT_STUB is truthy and the provider stage is offline (double-gated; the flag is set solely in dev_harness/config.py's offline child env, next to the existing STT_SERVICE_MODELS=parakeet pin). Transcript text is self-declaring synthetic ([offline stub transcript — no real speech recognized]) so harness output can never be mistaken for real transcription quality — in the app UI or in session evidence. Selection/telemetry still resolve normally; only the provider construction swaps.
  • Keyless geocode egress guard (backend/utils/conversations/location.py): both geocode helpers performed the maps.googleapis.com HTTP call even with GOOGLE_MAPS_API_KEY unset — observed as outbound traffic from a PROVIDER_MODE=offline session (offline strips the key). A keyless request can never succeed; both helpers now return None before any egress. Correct in production too, not just offline.

Product invariants affected

none

Failure class (fixes)

Failure-Class: none

Test plan

  • backend/tests/unit/test_prerecorded_stub.py (6): gate inert without the flag; requires offline stage (real/production refused); active only with both gates; word shape satisfies _words_cleaning; self-declaring deterministic output; return_language variant
  • backend/tests/unit/test_geocode_keyless_no_egress.py (2): both helpers return None without HTTP when the key is unset (HTTP layer monkeypatched to assert no egress); existing resilience tests still pass
  • scripts/dev-harness/tests/test_env_stage.py: offline child env sets OMI_STT_STUB=1; local mode never does
  • Live seam check with a payload the size of the observed phone upload: stub returns the synthetic transcript through prerecorded_from_bytes + _words_cleaning; flipping PROVIDER_MODE=real returns the real provider
  • Full dev-harness lane: 338 passed / 6 skipped / 65 xfailed
  • Hosted lanes on this head

Review in cubic

Offline sessions strip provider secrets by design, so uploaded captures
dead-ended at PrerecordedSTTConfigurationError and conversations never
finalized. Mirror the OMI_LLM_STUB pattern: a double-gated (OMI_STT_STUB
+ offline stage) deterministic provider whose transcript text is
self-declaring synthetic, selected only inside harness child envs.
Both geocode helpers fired the maps.googleapis.com request even with
GOOGLE_MAPS_API_KEY unset — pure egress noise from offline sessions,
where the key is stripped by design, and a request that can never
succeed anywhere. Return None before any egress.
@Git-on-my-level
Git-on-my-level merged commit 8a5c388 into main Sep 18, 2026
61 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/offline-stt-stub-and-geocode-guard branch September 18, 2026 04:32
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
Git-on-my-level added a commit that referenced this pull request Sep 18, 2026
…t tripwire (round 3) (#14537)

## Failure-Class
Failure-Class: FC-fixture-mock-signature-drift

## Summary
Round-3 completion of the #14513/#14485 CI-green restoration (rounds
1–2: #14528, #14533). Three remaining main-wide shard-2 failures:

1. `test_geocoding_cache.py` (13 failures): #14485's keyless-geocode
guard returns `None` before the API call when `GOOGLE_MAPS_API_KEY` is
unset, so every API-path test now exercises a dead path. Added an
autouse fixture setting a dummy key; the explicit no-key cache-hit test
keeps its own `clear=True` override, preserving its intent.
2.
`test_free_tier_cohort.py::test_coordinator_sites_still_read_the_flag_without_a_uid`:
the test documented its own deletion condition ("if the calls now carry
uid, delete it and the gap note together") — #14513 met it (both call
sites now pass `uid`). Deleted per its docstring, with the now-unused
`re` import.
3. `test_gateway_resilience.py`: passes standalone (3/3) —
shard-pollution follower, expected green once the real failures clear.

## Verification
- All three files: 74 passed from `backend/`
- Full sweep of every previously red file this program touched: green

## Product invariants affected

- INV-DATA-1

Preserved: test-only changes plus one autouse test fixture; no
production behavior, routing, or project binding touched.


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/14537?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant