Skip to content

fix: stabilize desktop 0.12.69 qualification contracts - #9425

Merged
Git-on-my-level merged 8 commits into
mainfrom
codex/issue-9414-tier2-qualification-fixes
Jul 11, 2026
Merged

Git-on-my-level merged 8 commits into
mainfrom
codex/issue-9414-tier2-qualification-fixes

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

Fixes #9414

Summary

  • restore released desktop/backend compatibility for goal creation and memory mutation contracts, with regenerated app-client schemas
  • preserve Omi sessions across TTS provider failures, distinguish provider quota from local rate limits, isolate caches, and prevent stale vocabulary hydration
  • make Tier-2 qualification deterministic across connector imports, floating chat, conversations, memory search/CRUD, speaker naming, vocabulary, clean profiles, and slugged qualification bundle identities
  • lazy-load Google Translate so the credential-free offline backend starts under the OrbStack-only Docker runtime

Product invariants affected

  • INV-AUTH-1: provider-boundary TTS failures do not invalidate the Firebase/Omi session
  • INV-CHAT-1: floating-bar voice playback remains an I/O surface against shared chat continuity (no forked transcript store)
  • INV-MEM-1: memory mutation contract changes preserve the three-tier product memory model
  • INV-INT-1: connector qualification fixtures inject only provider extraction and still traverse the real validation, durable-save, and outcome-mapping path

Verification

  • full backend test suite: 520 unit test files passed before the final conflict-free rebase
  • rebased focused backend suites: 116 passed
  • rebased focused Swift suites: 125 passed
  • backend import-side-effect, async-blocker, module-stub, typecheck, OpenAPI, generated-client, and workflow guards passed
  • INV-AUTH-1 desktop auth-session guard passed
  • shell harness and qualification bootstrap contract suites passed
  • real named-bundle Tier-2 qualification passed: 35 flows plus spatial-overlay dogfood, offline provider mode, OrbStack runtime
  • independent Terra review approved the final diff with no blockers

Tier-2 evidence: desktop/macos/.harness/desktop-core/20260711T010431Z-t2 (local generated evidence, not committed)

Notes

  • includes the required desktop changelog fragment
  • local qualification used the disposable omi-issue-9414 bundle; production Omi was not touched

Accept released goal source/description aliases, support canonical memory mutation bodies with legacy query compatibility, and lazy-load Google Translate for credential-free local startup.

Verification:
- backend/test.sh (520 unit test files, pass)
- pytest goal/memory/translation focused suites (116 passed)
- import-side-effect, async-blocker, and module-stub guards (pass)
Preserve Firebase sessions across provider TTS failures, classify provider versus local quotas, round-trip transcription preferences, canonicalize goal sources, isolate TTS caches, and prevent stale vocabulary hydration.

Verification:
- xcrun swift test focused affected suites (125 passed)
- INV-AUTH-1 desktop auth session guard (pass)
- desktop named-bundle Tier-2 qualification (pass)
Harden bridge synchronization, numeric and existence expectations, real connector fixture routing, clean qualification profiles, and slug-aware bundle identity checks.

Verification:
- omi-harness and qualification bootstrap contract suites (pass)
- Tier-2: 35 flows plus spatial-overlay dogfood (pass)
- evidence: desktop/macos/.harness/desktop-core/20260711T010431Z-t2
Regenerate the app-client OpenAPI snapshot for canonical memory mutation bodies and deprecated legacy query parameters.

Verification:
- export_openapi.py --surface app-client --write
- pre-push OpenAPI contract check
@mintlify

mintlify Bot commented Jul 11, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
omi 🟢 Ready View Preview Jul 11, 2026, 1:18 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3fdf16a93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +6156 to +6158
} catch APIError.unauthorized {
let mode: CredentialAuthMode = APIKeyService.isByokActive ? .byok : .managed
throw CredentialHealthError.providerAuth(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve backend auth 401s as login failures

When /v1/tts/synthesize returns 401 because the desktop backend rejected the Firebase token (the route is still protected by the auth/paywall extractor before it ever calls OpenAI), performAuthenticatedData collapses that response into APIError.unauthorized and this catch converts it to an OpenAI provider-auth failure. With .providerCredentialBoundary also disabling signOutOn401, a revoked/invalid Omi session during voice playback is left signed in and shown as a voice-provider fallback instead of requiring login. Please distinguish backend-auth 401s from upstream provider 401s after the forced refresh, rather than mapping every unauthorized response here to providerAuth.

Useful? React with 👍 / 👎.

Git-on-my-level and others added 2 commits July 10, 2026 21:35
Only remap OpenAI-shaped TTS 401s to providerAuth (preserving session and
avoiding BYOK fingerprint poison); invalidate on bare/Firebase 401s. Cover
Goals services in e2e, mark legacy memory query params deprecated, and gate
connector fixtures to non-prod builds.

Verification:
- APIClientAuthRetryTests (5 passed)
- pytest test_memory_mutation_contract (14 passed)
- INV-AUTH-1 ratchet + pr-preflight (pass)

Co-authored-by: Cursor <[email protected]>
File-isolation amortizes FastAPI/router import into the first node ID;
grandfather it so pre-push timing guard matches other memory unit files.

Verification:
- BACKEND_UNIT_TEST_FILE_LIST=test_memory_mutation_contract.py bash test.sh (14 passed)

Co-authored-by: Cursor <[email protected]>
@Git-on-my-level

Copy link
Copy Markdown
Member Author

Addressed the Codex P1 on TTS 401 handling:

  • OpenAI-shaped /v1/tts/synthesize 401 bodies (OpenAI TTS request failed:…) still map to providerAuth without signing out (INV-AUTH-1 / no BYOK poison).
  • Bare/Firebase-shaped post-refresh 401s now invalidate the session and throw APIError.unauthorized instead of being remapped to provider auth.
  • Also landed CI fixes: Goals e2e covers, OpenAPI deprecated: true on legacy memory query params, non-prod guard on connector extraction fixtures, and fast-unit allowlist for the memory mutation contract first-test import cost.

Align the snapshot with backend/.openapi-venv so pre-push OpenAPI contract
checks pass after the deprecated memory query-param change.

Verification:
- backend/.openapi-venv/bin/python scripts/export_openapi.py --surface app-client --check

Co-authored-by: Cursor <[email protected]>
Stub @timeit on the chat quota harness endpoints module so chat.py can
import pre_recorded, and allowlist the Parakeet runtime-env validator
node that exceeds the file-isolation CPU fail limit.

Verification:
- BACKEND_UNIT_TEST_FILE_LIST for the two previously failing files via bash test.sh (28 passed)

Co-authored-by: Cursor <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 5311f58 into main Jul 11, 2026
24 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/issue-9414-tier2-qualification-fixes branch July 11, 2026 02:07
Git-on-my-level added a commit that referenced this pull request Jul 11, 2026
## What changed and why

Recent macOS and backend bug-fix PRs were clustering around the same
missing contracts: re-entrant desktop state publication, duplicate
external IDs, hidden blocking work, runtime/deploy drift,
released-client schema breaks, and selective CI that could silently miss
tests. This replaces those one-off repairs with shared policies,
behavioral harnesses, compatibility checks, and fail-closed CI
selection.

The main durable changes are:

- FIFO/non-reentrant voice-turn dispatch, explicit last-write-wins
collection construction, duplicate-input tests, and a desktop
test-quality ratchet for trapping dictionaries, source-inspection debt,
and wall-clock waits.
- A pure prerecorded-STT provider contract shared by runtime selection
and deploy validation, lazy/thread-safe Deepgram construction,
controlled configuration failures, and complete dev/prod desired-state
bindings.
- Directional app-client OpenAPI compatibility checking against the
merge base, plus transitive module-local async-blocker analysis.
- One rename/delete/type-aware changed-path primitive, conservative
backend test selection, dedicated import-isolation gates, and complete
desktop agent Vitest discovery.
- Agent/PR guidance that requires a bug fix to close the failure class,
not only its current symptom. The evidence and guard hierarchy are
recorded in `docs/operational/systemic_bug_hardening.md`.

## Product invariants affected

- `INV-CHAT-1`: floating-control-bar, PTT, task-chat, and `ChatProvider`
paths are touched. The shared-transcript/session ownership model is
unchanged; the PTT coordinator now publishes transitions atomically
under nested callbacks.
- `INV-AUTH-1`: `ChatProvider.swift` is touched only to adopt
deterministic duplicate-key handling. Session invalidation and auth
recovery behavior are unchanged.
- `INV-INT-1`: `MemoryExportService.swift` is touched only to replace a
trapping dictionary constructor with the shared duplicate-key policy.
Integration ownership and capability behavior are unchanged.
- `INV-MEM-1`: the same `MemoryExportService.swift` mechanical migration
does not change memory tiers, canonical storage, or read/write routing.

## How it was verified

- `cd desktop/macos && OMI_SWIFT_TEST_SUITE_WORKERS=4
./scripts/swift-test-suites.sh` — all 219 Swift suites passed; the
desktop quality checker and its 11 fixture tests passed. Its
source-inspection ratchet is pinned to current-main debt (62 files / 171
sites) and permits no increase from this PR.
- `cd desktop/macos && rm -rf Desktop/.build && xcrun swift build -c
release --package-path Desktop --triple arm64-apple-macosx` — clean
arm64 release build passed.
- Built and launched `/Applications/omi-systemic-guards.app` with ad-hoc
signing. Exercised the real PTT semantic actions through idle →
recording → terminal-too-short; automation state reported zero invalid
and zero stale transitions.
- `cd backend && bash test.sh` — the complete selector-discovered suite
of 525 backend test files passed under file isolation and the strict
local CPU guard.
- `cd backend && PATH=/tmp/omi-python-bin:$PATH bash
scripts/pre-deploy-check.sh` — dev/prod runtime contracts and 50
deploy-safety tests passed.
- Import-purity scan: 637 production files, zero violations. Module-stub
pollution scan: 580 test files, zero violations. All-category async diff
scan: zero selected findings.
- App-client OpenAPI compatibility passed against current `origin/main`
(`2a14a9ee78153ac353afc2d5e43ffa328650a6f6`); all 19 checker tests
passed.
- `bash backend/scripts/typecheck.sh` — zero type errors.
- `scripts/pre-push` — all commit-aware local gates passed, including
OpenAPI/model freshness, actionlint, desktop suites, and the complete
desktop agent tool surface.
- Independent agent review found four test/wiring gaps; each was fixed
and the final review approved the updated tree.

No production deploy was performed. `backend/deploy/runtime_env.yaml`
changes checked-in desired state and will take effect only through the
normal deployment workflows.

## Tests

- `VoiceTurnCoordinatorTests` now reproduces nested effect/snapshot
callbacks and proves FIFO publication without recursion.
- `DictionaryDeduplicationTests` proves the shared collision policy; the
static checker rejects future trapping initializers and unreasoned
escapes.
- `test_prerecorded_stt_config.py`, provider tests, and
runtime-validator tests cover dynamic selectors, missing dependencies,
BYOK, fallback requirements, and dev/prod surfaces.
- `test_app_client_openapi_compatibility.py` covers request/response
directionality, status/media/security changes, enums, arrays, maps,
unions, constraints, and recursive references.
- `test_scan_async_blockers.py` covers transitive helpers, cycles, diff
scope, and safe executor offload.
- Workflow/path tests cover unknown sources, mixed direct+unmapped
changes, deleted tests, both rename sides, file-to-symlink type changes,
hook fallback, and full agent test discovery.

## Root cause and durable guard (bug fixes)

- Desktop lifecycle chain (`#9402`, `#9411`, `#9420`, `#9424`, `#9428`):
synchronous callbacks could advance a half-published transition. The
coordinator now owns a non-reentrant event queue, backed by
reducer-level behavior tests.
- Duplicate-ID crash class (`#9288` and adjacent sites): boundary data
was incorrectly assumed unique. A named collision policy replaces every
trapping production constructor, and CI rejects recurrence.
- Runtime/provider drift (`#9296`, `#9308`, `#9358`, `#9385`, `#9421`,
`#9422`): runtime choice and deploy dependencies had separate owners.
One pure provider contract now drives both, with lazy client
construction preserving import purity.
- Released-client break (`#9425`): schema freshness alone did not prove
compatibility. CI now compares contracts in the direction requests and
responses actually flow.
- False-green test selection: rename/deletion/type changes and unknown
production sources could escape intended gates, while the desktop agent
harness ran only a hand-picked subset. Selection now fails toward
broader coverage and discovers the complete suite.

## Scoped cleanups (optional)

- The backend test runner now caps nested BLAS/OpenMP pools per isolated
pytest worker, preventing oversubscription from corrupting per-test CPU
attribution while preserving explicit overrides.
- Runtime workflow validation reuses the already-parsed manifest instead
of reparsing it once per workflow.
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.

Classify macOS Tier-2 beta qualification failures: real regressions vs harness drift

1 participant