Skip to content

Fix cross-platform This device memory filtering - #9364

Merged
Git-on-my-level merged 5 commits into
mainfrom
codex/fix-memory-device-filter
Jul 10, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
codex/fix-memory-device-filter

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Summary

  • Fix the macOS This device filter for both legacy and canonical memories.
  • Preserve capture-device provenance through mobile offline sync (inline and Cloud Tasks), conversation merging, Windows capture/API requests, and web capture/API requests.
  • Document the /v4/listen and browser /v4/web/listen provenance transport.

Root cause

The original implementation treated the device filter as a desktop read-path concern while several write paths either omitted device identity or discarded it before canonical extraction. Legacy filtering also rejected the scoped query before desktop could apply its compatibility fallback.

Product invariants affected

  • INV-MEM-1 — device provenance remains non-authoritative metadata; this does not change canonical tier counts, default policy, or eligibility.

Validation

  • cd backend && bash test.sh — passed all 495 backend unit-test files.
  • bash backend/testing/e2e/run.sh -q --tb=short — passed the hermetic backend e2e harness.
  • python3 desktop/macos/scripts/check-e2e-flow-coverage.py --strict --base origin/main — passed.
  • cd desktop/macos && OMI_SWIFT_TEST_SUITE_WORKERS=4 ./scripts/swift-test-suites.sh — passed.
  • cd desktop/windows && pnpm run typecheck && pnpm run lint && pnpm test — passed (550 tests, 3 skipped).
  • cd web/app && npm run build with CI dummy Firebase env — passed.
  • Full pre-push gate, backend import-purity, async-blocker, module-stub-pollution, and OpenAPI-contract checks — passed.

Manual verification

  • The original macOS focused Swift tests passed. A locally named app bundle could not be exercised because the unrelated ad-hoc Sparkle signature issue prevents launch on this machine.

Keep legacy rows visible after unsupported device scope, preserve the existing production device identity when migrating to scoped Keychain storage, and stamp desktop manual and streamed capture provenance for canonical memory filtering.

Verification: 62 focused backend tests passed; 24 focused desktop tests passed; backend import-side-effect, async-blocker, module-stub, and fallback instrumentation checks passed. Named bundle built and installed, but local UI launch remains blocked by a Sparkle dyld code-signature error after the prescribed ad-hoc re-sign.
@Git-on-my-level
Git-on-my-level marked this pull request as ready for review July 9, 2026 21:55
@Git-on-my-level Git-on-my-level changed the title Fix desktop This device memory filtering Fix cross-platform This device memory filtering Jul 9, 2026
@Git-on-my-level

Copy link
Copy Markdown
Member Author

@codex review

@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: e136ff5032

ℹ️ 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".

localStorage.setItem(WEB_DEVICE_ID_KEY, deviceId);
}

const digest = await crypto.subtle.digest(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve existing web FCM device keys during rehash

For browsers that already have omi-web-device-id, this now derives a SHA-256 prefix instead of the integer hash that registerFCMToken previously used for the users/{uid}/fcm_tokens/web_<hash> document. save_token only removes unknown_default, and get_all_tokens later streams every fcm_tokens document, so the same web FCM token will remain under the old key and be registered again under the new key, causing duplicate notification sends until those stale docs are cleaned up. Please migrate/delete the old web key by token or keep the FCM device key stable while adding the provenance hash.

Useful? React with 👍 / 👎.

@mintlify

mintlify Bot commented Jul 9, 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 9, 2026, 10:53 PM

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

@Git-on-my-level
Git-on-my-level merged commit 9ff4420 into main Jul 10, 2026
24 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/fix-memory-device-filter branch July 10, 2026 00:00
Git-on-my-level added a commit that referenced this pull request Jul 10, 2026
…covers)

Conflicts resolved across 3 files:
- backend/routers/sync.py: combined client_device import with pipeline imports;
  kept HEAD (pipeline-extracted) versions of inline functions; device params
  already threaded by main's #9364 endpoint changes
- backend/utils/sync/pipeline.py: added client_device_id/client_platform params
  to process_segment and _run_full_pipeline_background_async; pass through to
  CreateConversation (main's #9364 device provenance)
- backend/tests/unit/test_sync_v2.py: kept both log_sanitizer and client_device
  mock stubs from both sides
- desktop/macos/e2e/flows/capture-lifecycle.yaml: kept both STTSessionState and
  TranscriptionService cover paths
Git-on-my-level added a commit that referenced this pull request Jul 10, 2026
Main's #9364 added X-App-Platform/X-Device-Id-Hash Header() params to the v2
sync endpoint, but the merge resolution dropped the Header import from fastapi.

This branch was successfully deployed

1 active deployment
staging - docs — 6f236b1f Deployed Jul 9, 2026 by mintlify[bot]
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