Repository navigation
feat(desktop): instrument macOS memory activation and extraction outcomes - #10543
Git-on-my-level merged 14 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea7fca8be3
ℹ️ 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".
3da50ea to
0a5a86e
Compare
|
Monitor run confirmed the two Codex P2 review threads are resolved in code and both show
Both fixes were pushed in prior commit |
…ipt extraction
Close the validated macOS memory-funnel observability gap (SCA-99) with three
privacy-safe, bounded product-analytics events. No product behavior, gate,
cadence, confidence threshold, model/provider, paywall, recording/reconciliation,
backend extraction, or existing-event-semantics change.
Desktop (proactive MemoryAssistant):
- Memory Assistant Setting Changed {setting, value} on a user-initiated
persisted change to enabled / notifications_enabled, so the true activation
denominator (monitoring users with notifications on) becomes measurable.
- Memory Assistant Analysis Run {outcome[, confidence_bucket]} per actual Gemini
analysis attempt; closed outcome enum {synced, filtered_low_confidence,
no_new_memory, sync_failed, analysis_failed}. Supplements — does not alter —
the existing Memory Extracted success terminal.
Backend (transcript-conversation memory extraction):
- Conversation Memories Extracted {memory_count_bucket, source, path} emitted
exactly once after durable successful persistence at the extract_memories
boundary; zero extraction and persistence failures emit nothing.
Docs: release-health-metrics.md documents the three metrics and states that
recording users are not the proactive-memory denominator and that Memory Created
is not an extracted-memory proxy.
…empotency Addresses coordinator review of the macOS memory telemetry PR. Refines the feature (no production failure class applies; telemetry-contract hardening). Desktop — `Memory Assistant Setting Changed` now fires only from explicit user intent, never from remote sync / migrations / defaults / resets: - Remove telemetry from the `isEnabled` / `notificationsEnabled` setters (they are written by `SettingsSyncManager.applyRemoteSettings` and `resetToDefaults`, so they must stay silent). - Add `MemoryAssistantSettings.applyUserSettingChange(_:value:)` as the single user-intent entry point; route the two UI `.onChange` toggle handlers through it. - Add a `@MainActor`-isolated `emitSettingChange` test seam on `MemoryAssistantTelemetry` so the wiring is behaviorally testable. - Tests prove: a user toggle emits exactly one closed event only on a real change; the raw setters (remote sync) emit zero; `applyRemoteSettings` emits zero; `resetToDefaults` emits zero. Backend — `Conversation Memories Extracted` is now durable-idempotent per (uid, conversation) across retries/re-finalization (no more re-emit on retry): - Add `try_acquire_conversation_memory_analytics_lock` (atomic Redis `SET NX EX`, 30-day TTL, mirrors `try_acquire_conversation_goal_lock`; fail-open on Redis error). - Claim the per-conversation slot before capture; a retry finds it held and emits nothing. `conversation_id` is the lock key only — never a PostHog property. - Tests prove: first pass emits; retries for the same conversation do not; distinct conversations emit independently; zero/failure emit nothing; PostHog/Redis failure is swallowed.
Failure-Class: none
Failure-Class: none
4cd8285 to
cda13d2
Compare
|
@cursor sync main and fix CI |
MemoryExportStatusTests and SBOnboardingCloudContextStateTests call DesktopDiagnosticsManager.shared.resetForTests(), which is guarded by #if DEBUG. The Desktop Swift CI --release-notification-regression step compiles the test target in release mode, so these two suites failed with 'value of type DesktopDiagnosticsManager has no member resetForTests' and broke every desktop-Swift-touching PR. Sibling suites (VoiceTurnCoordinatorTests, RealtimeHubSessionHandoffPolicyTests) already follow the same omi-release-compile #if DEBUG convention; this matches it. No test logic changed — only indentation and guards. Pre-existing on main; surfaced once a PR actually triggers the desktop Swift lane (main skips it when no Swift changes).
|
Pushed commit Root cause. This is pre-existing on Fix. Wrapped both suites in Local verification.
CI. The two Codex P2 review threads remain resolved in code ( |
…ipt extraction
Close the validated macOS memory-funnel observability gap (SCA-99) with three
privacy-safe, bounded product-analytics events. No product behavior, gate,
cadence, confidence threshold, model/provider, paywall, recording/reconciliation,
backend extraction, or existing-event-semantics change.
Desktop (proactive MemoryAssistant):
- Memory Assistant Setting Changed {setting, value} on a user-initiated
persisted change to enabled / notifications_enabled, so the true activation
denominator (monitoring users with notifications on) becomes measurable.
- Memory Assistant Analysis Run {outcome[, confidence_bucket]} per actual Gemini
analysis attempt; closed outcome enum {synced, filtered_low_confidence,
no_new_memory, sync_failed, analysis_failed}. Supplements — does not alter —
the existing Memory Extracted success terminal.
Backend (transcript-conversation memory extraction):
- Conversation Memories Extracted {memory_count_bucket, source, path} emitted
exactly once after durable successful persistence at the extract_memories
boundary; zero extraction and persistence failures emit nothing.
Docs: release-health-metrics.md documents the three metrics and states that
recording users are not the proactive-memory denominator and that Memory Created
is not an extracted-memory proxy.
…empotency Addresses coordinator review of the macOS memory telemetry PR. Refines the feature (no production failure class applies; telemetry-contract hardening). Desktop — `Memory Assistant Setting Changed` now fires only from explicit user intent, never from remote sync / migrations / defaults / resets: - Remove telemetry from the `isEnabled` / `notificationsEnabled` setters (they are written by `SettingsSyncManager.applyRemoteSettings` and `resetToDefaults`, so they must stay silent). - Add `MemoryAssistantSettings.applyUserSettingChange(_:value:)` as the single user-intent entry point; route the two UI `.onChange` toggle handlers through it. - Add a `@MainActor`-isolated `emitSettingChange` test seam on `MemoryAssistantTelemetry` so the wiring is behaviorally testable. - Tests prove: a user toggle emits exactly one closed event only on a real change; the raw setters (remote sync) emit zero; `applyRemoteSettings` emits zero; `resetToDefaults` emits zero. Backend — `Conversation Memories Extracted` is now durable-idempotent per (uid, conversation) across retries/re-finalization (no more re-emit on retry): - Add `try_acquire_conversation_memory_analytics_lock` (atomic Redis `SET NX EX`, 30-day TTL, mirrors `try_acquire_conversation_goal_lock`; fail-open on Redis error). - Claim the per-conversation slot before capture; a retry finds it held and emits nothing. `conversation_id` is the lock key only — never a PostHog property. - Tests prove: first pass emits; retries for the same conversation do not; distinct conversations emit independently; zero/failure emit nothing; PostHog/Redis failure is swallowed.
Failure-Class: none
Failure-Class: none
Failure-Class: none
# Conflicts: # desktop/macos/Desktop/Sources/Logger.swift
Summary
Verification
backend/.venv/bin/python -m pytest -q backend/tests/unit/test_conversation_memories_telemetry.py backend/tests/unit/test_fallback_observability.py backend/tests/unit/test_kg_user_type_mismatch.py(39 passed)xcrun swift test --package-path desktop/macos/Desktop --filter MemoryAssistant(12 passed)xcrun swift test -c release --package-path desktop/macos/Desktop --filter UserNotificationCallbackBridgeTests/(optimized app and test target compiled; 3 passed)xcrun swift test -c release --package-path desktop/macos/Desktop --skip-build --filter 'MemoryExportStatusTests|SBOnboardingCloudContextStateTests'(25 passed)OMI_PR_BODY_FILE=pr-body.md make preflight(30 checks passed)GitHub CI
All 11 authoritative workflows succeeded on head
ee351531292d507a9f00d21ffc117b2e5aef1eb0. Desktop Swift CI passed the full app suite and the Xcode 16.4 release-modeUserNotificationCallbackBridgeTestsregression step.Failure class (fixes)
Failure-Class: none