Skip to content

fix(desktop): close .113 stability failure classes - #10426

Merged
Git-on-my-level merged 8 commits into
mainfrom
codex/issue-10420-desktop-stability
Jul 23, 2026
Merged

Git-on-my-level merged 8 commits into
mainfrom
codex/issue-10420-desktop-stability

Conversation

@Git-on-my-level

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

Copy link
Copy Markdown
Member

Fixes #10420

Summary

  • Make OCR frame extraction single-owner: Vision callback success/failure and synchronous perform throws now race through one lock-protected completion owner, so the continuation can be resumed exactly once.
  • Serialize every Realtime Hub replacement behind physical WebSocket shutdown acknowledgement. Cancel, stale owner, provider mismatch, failover, barge-in, and reconnect paths now share the same gate; duplicate close/error callbacks terminalize once.
  • Add typed EADDRNOTAVAIL classification and bounded Realtime Sentry reports. Raw provider/system close text remains local-only.
  • Replace repeated memory-threshold alerts with an episode model (hysteresis plus bounded cadence), component fingerprints, and bounded encoder/Rewind diagnostics.
  • Isolate the distributed-notification selector from actor inference and register production/test observers through one seam.
  • Regroup desktop errors by bounded source owner/error family, drop the exact stale heartbeat issue event while retaining its breadcrumb, and publish UUID-verified universal dSYMs to Sentry and GitHub releases.
  • Isolate the qualification-cache Git fixture from hook-exported repository variables; the pre-push sequence can no longer reinitialize its caller's worktree.

Root cause and confidence

  • OCR continuation misuse — confirmed. The synchronous Vision throw path and request callback independently owned the same checked continuation. The new completion owner closes that failure class in either callback order.
  • Realtime reconnect failures — leading code root, strongly supported. Replacement paths waited for logical state/queue drain but not the underlying transport's terminal callback, allowing overlapping sockets and EADDRNOTAVAIL. A single replacement authority now waits for NWConnection failed/cancelled or URLSessionWebSocketTask completion before reconnecting.
  • Memory alerts — confirmed observability defect, likely contributor still under measurement. Threshold crossings had no episode identity, hysteresis, or component context, so one pressure period emitted repeated indistinguishable alerts. Episode state and lifecycle fingerprints make the next occurrence attributable without alert storms.
  • Notification queue assertion — leading-hypothesis hardening. The selector was actor-sensitive even though DistributedNotificationCenter invokes it on a framework queue. The report lacks a dSYM and a second diagnostic frame, so this PR fixes the unsafe boundary but does not claim that historical crash is conclusively symbolicated.
  • Generic hangs/errors — observability gap. The .113 build did not publish dSYMs and grouped unrelated failures under free-form messages. This PR cannot retroactively symbolicate those events; it makes the next published build actionable.

Recurrence evidence and durable guards

The issue and follow-up comment show repeated memory-pressure episodes, reconnect/address-allocation failures, generic desktop errors, and a double-resume OCR signature. Behavioral tests now cover reverse-order OCR completions, threshold/hysteresis transitions, production notification registration and delivery, delayed physical transport shutdown, all replacement entry points, stale callbacks, and duplicate close/error callbacks. Release contract tests require the dSYM UUIDs to match the shipped universal executable before upload/publication.

Real-path exercise

Built and launched /Applications/omi-10420-stability.app (com.omi.omi-10420-stability) as a named non-production bundle. Confirmed app state and Rewind settings through the in-process automation bridge, posted the real com.omi.test.focus distributed notification, and observed registration plus delivery without a queue assertion or continuation misuse. Only that named test bundle was stopped.

Verification

  • xcrun swift test --package-path desktop/macos/Desktop — 3,048 tests passed, 1 skipped, 0 failures
  • desktop/macos/scripts/agent-logic-harness --swift-only — 508 tests passed
  • Focused post-extraction Realtime/Sentry suites — 64 tests passed
  • desktop/macos/scripts/check_desktop_test_quality.py — passed (55 files, 154 assertion sites)
  • desktop/macos/scripts/swiftlint-wrapper.sh lint — 0 violations
  • dSYM publish harness, release workflow contract tests, and release-process guard — passed
  • make preflight / scripts/pr-preflight --pr-body-file — passed

Product invariants affected

  • INV-AUTH-1
  • INV-CHAT-1
  • INV-DATA-1
  • INV-BETA-1
  • INV-VOICE-1

Failure class (fixes)

Failure-Class: FC-split-mutation-authority

Review in cubic

Failure-Class: new

Verified: dSYM publication harness, release workflow guard, desktop telemetry tests, and full Swift suite.
Failure-Class: FC-usernotifications-callback-isolation

Verified: selector registration test posts off-main and enters the MainActor; named bundle accepted a real distributed notification without a queue assertion.
Failure-Class: new

Verified: memory pressure transitions, competing Vision completions, encoder finalization, Rewind extraction, and full Swift suite.
Failure-Class: new

Verified: 20 handoff tests, 16 close-classifier tests, lifecycle/reconnect suites, 508-test agent harness, and full Swift suite.
Verified: the previously unbuildable test target now compiles and all 3,048 Swift tests pass.
Verified: product line-count ratchet targets are below baseline and 64 focused telemetry/realtime tests pass.
@Git-on-my-level
Git-on-my-level merged commit a49db71 into main Jul 23, 2026
27 of 32 checks passed
@Git-on-my-level
Git-on-my-level deleted the codex/issue-10420-desktop-stability branch July 23, 2026 20:14

@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: 0bb5c9eb0e

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


// Update Sentry context with current resources
updateSentryContext(snapshot)
await updateRuntimeActivityContext()

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 Run memory safety checks before actor diagnostics

When memory pressure is caused by Rewind/encoder work, this new await can suspend behind VideoChunkEncoder.shared.getBufferStatus() before checkMemoryThresholds runs, so the monitor never reaches the critical remediation or extreme auto-restart path it is meant to trigger. Keep the threshold/autorestart decision ahead of actor-based diagnostics, or make the diagnostic refresh best-effort with a timeout, so a wedged encoder cannot suppress memory recovery.

Useful? React with 👍 / 👎.

undivisible pushed a commit to undivisible/omi that referenced this pull request Sep 29, 2026
Fixes BasedHardware#10420

## Summary

- Make OCR frame extraction single-owner: Vision callback
success/failure and synchronous `perform` throws now race through one
lock-protected completion owner, so the continuation can be resumed
exactly once.
- Serialize every Realtime Hub replacement behind physical WebSocket
shutdown acknowledgement. Cancel, stale owner, provider mismatch,
failover, barge-in, and reconnect paths now share the same gate;
duplicate close/error callbacks terminalize once.
- Add typed `EADDRNOTAVAIL` classification and bounded Realtime Sentry
reports. Raw provider/system close text remains local-only.
- Replace repeated memory-threshold alerts with an episode model
(hysteresis plus bounded cadence), component fingerprints, and bounded
encoder/Rewind diagnostics.
- Isolate the distributed-notification selector from actor inference and
register production/test observers through one seam.
- Regroup desktop errors by bounded source owner/error family, drop the
exact stale heartbeat issue event while retaining its breadcrumb, and
publish UUID-verified universal dSYMs to Sentry and GitHub releases.
- Isolate the qualification-cache Git fixture from hook-exported
repository variables; the pre-push sequence can no longer reinitialize
its caller's worktree.

## Root cause and confidence

- **OCR continuation misuse — confirmed.** The synchronous Vision throw
path and request callback independently owned the same checked
continuation. The new completion owner closes that failure class in
either callback order.
- **Realtime reconnect failures — leading code root, strongly
supported.** Replacement paths waited for logical state/queue drain but
not the underlying transport's terminal callback, allowing overlapping
sockets and `EADDRNOTAVAIL`. A single replacement authority now waits
for `NWConnection` failed/cancelled or `URLSessionWebSocketTask`
completion before reconnecting.
- **Memory alerts — confirmed observability defect, likely contributor
still under measurement.** Threshold crossings had no episode identity,
hysteresis, or component context, so one pressure period emitted
repeated indistinguishable alerts. Episode state and lifecycle
fingerprints make the next occurrence attributable without alert storms.
- **Notification queue assertion — leading-hypothesis hardening.** The
selector was actor-sensitive even though DistributedNotificationCenter
invokes it on a framework queue. The report lacks a dSYM and a second
diagnostic frame, so this PR fixes the unsafe boundary but does not
claim that historical crash is conclusively symbolicated.
- **Generic hangs/errors — observability gap.** The `.113` build did not
publish dSYMs and grouped unrelated failures under free-form messages.
This PR cannot retroactively symbolicate those events; it makes the next
published build actionable.

## Recurrence evidence and durable guards

The issue and follow-up comment show repeated memory-pressure episodes,
reconnect/address-allocation failures, generic desktop errors, and a
double-resume OCR signature. Behavioral tests now cover reverse-order
OCR completions, threshold/hysteresis transitions, production
notification registration and delivery, delayed physical transport
shutdown, all replacement entry points, stale callbacks, and duplicate
close/error callbacks. Release contract tests require the dSYM UUIDs to
match the shipped universal executable before upload/publication.

## Real-path exercise

Built and launched `/Applications/omi-10420-stability.app`
(`com.omi.omi-10420-stability`) as a named non-production bundle.
Confirmed app state and Rewind settings through the in-process
automation bridge, posted the real `com.omi.test.focus` distributed
notification, and observed registration plus delivery without a queue
assertion or continuation misuse. Only that named test bundle was
stopped.

## Verification

- `xcrun swift test --package-path desktop/macos/Desktop` — 3,048 tests
passed, 1 skipped, 0 failures
- `desktop/macos/scripts/agent-logic-harness --swift-only` — 508 tests
passed
- Focused post-extraction Realtime/Sentry suites — 64 tests passed
- `desktop/macos/scripts/check_desktop_test_quality.py` — passed (55
files, 154 assertion sites)
- `desktop/macos/scripts/swiftlint-wrapper.sh lint` — 0 violations
- dSYM publish harness, release workflow contract tests, and
release-process guard — passed
- `make preflight` / `scripts/pr-preflight --pr-body-file` — passed

## Product invariants affected

- INV-AUTH-1
- INV-CHAT-1
- INV-DATA-1
- INV-BETA-1
- INV-VOICE-1

## Failure class (fixes)

Failure-Class: FC-split-mutation-authority


<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/BasedHardware/omi/pull/10426?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.

macOS stable 0.12.113: root-cause release-scoped Sentry errors, memory pressure, hangs, and Realtime failures

1 participant