Repository navigation
fix(desktop): Hide-for-2h keeps notifications; Maximum level nudges in ~10s with 30s repeats; unsilence suggestions from the buckets flag - #11553
Conversation
…ions
The floating bar's right-click action (was 'Disable for 2 hours') silently
suppressed every proactive notification for two hours — one click to get the
bar out of the way for a movie muted an hour of nudges at maximum frequency,
with nothing anywhere saying so.
Hiding is now a statement about the bar only:
- The menu item says what it does: 'Hide for 2 hours'.
- snooze() just hides the window and keeps the queue; cards present via the
existing temp-show path over the hidden bar and it re-hides afterwards.
- The snooze/hide state is structurally removed from every delivery gate —
sendNotification, showNotification, the context-director gate
(ContextDeliveryGateInput), contextual task interruptions
(TaskInterruptionEnvironment) and the suggestion gate (SuggestionGatePolicy)
no longer take a snoozed input, so no future gate can quietly consult it.
- Dead .snoozed telemetry reasons removed with their writers; the Codable
TaskInterruptionGateReason.snoozed case stays so old persisted traces decode.
Verified live on omi-ankara (this branch): with floatingBar_snoozedUntil set
2h ahead — the exact state that muted the movie hour and returned six straight
'snoozed' probe outcomes on the previous build — probe_suggestion_nudge
delivered and spoke a real-task nudge ('Suggestion: delivering [90%] …' →
'NotificationSpeech: speaking delivered notification (79 chars)'), visible in
the chat transcript. Affected suites: 137 tests, 0 failures.
At Maximum (level 5) the suggestion dwell drops to 10 s and the same-context frame re-flush cadence drops to 10 s, so opening TikTok produces an eligible evaluation ~10-13 s after the switch. Balanced and below keep the 30 s dwell and 60 s cadence — ordinary use unchanged. Assistant-side gates (cooldown, daily budget, grounding) still bound model spend at every level. Also: a temp-shown notification now re-hides the bar when the hide window is active — 'Hide for 2 hours' keeps isEnabled true, so the re-hide must also arm on the hidden (snoozed) state or the first nudge would bring the bar back for the rest of the window (parent-session review finding). Policy tests: dwell and fallback cadence are 10 s ONLY at level 5.
The 180 s between-nudge cooldown made repeat demos impossible at Maximum — the gate re-checked every ~10 s and refused with skippedCooldown for three minutes after each delivery. Maximum now caps the cooldown at 30 s (SuggestionGatePolicy.cooldown(base:frequencyLevel:)); every other level keeps the user's configured value untouched. Policy test pins 30 s only at level 5.
…ets flag The buckets rollout gated SuggestionAssistant.isEnabled on !ContextBucketsFeature.isEnabled; with the PostHog flag now at 100% the assistant reported 'disabled' on every fresh sign-in and focus nudges went silent fleet-wide (observed live on this account 02:24). Same hunk as the concurrent fix on kodjima33/buckets-starve-suggestions (verbatim, so the branches merge cleanly); credit to that session's diagnosis.
There was a problem hiding this comment.
4 issues found across 21 files
Confidence score: 3/5
- In
SuggestionAssistant.swift,lastEvaluationAtis set beforeevaluate, so long Gemini calls can effectively bypass the intended cooldown and trigger back-to-back evaluations when the call returns, increasing suggestion churn and API load—record the cooldown timestamp when presenting (or after completion) so elapsed call time doesn’t open an immediate re-run window. - In
FloatingControlBarWindow.swift, a pre-existing six-second dismissal timer is not canceled on snooze, so an old timer can dismiss a newly shown card and incorrectly advance that queue state—cancel/reset any active card timer on snooze and when swapping cards to keep dismissal ownership aligned with the visible card. desktop/macos/changelog/unreleased/20260814-maximum-level-fast-nudges.jsonandContextDeliveryAuthority.swiftare low-severity cleanup items, but they can still cause avoidable friction (changelog rule failure and deadsnoozedgate reason path)—update the fragment prefix to an allowed verb and remove or rewire the unreachable enum case.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/changelog/unreleased/20260814-maximum-level-fast-nudges.json">
<violation number="1" location="desktop/macos/changelog/unreleased/20260814-maximum-level-fast-nudges.json:2">
P3: The changelog fragment must start with "Fixed", "Added", "Improved", or "Changed", per the changelog fragment rules in AGENTS.md, but it currently begins with "At Maximum notification level". Change it to start with one of those verbs, e.g. "Changed: At Maximum notification level, nudges arrive within ~10 seconds ...".</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/Suggestions/SuggestionAssistant.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/Suggestions/SuggestionAssistant.swift:152">
P2: When a Gemini call lasts more than 30 seconds, this permits the next evaluation immediately after the first returns because `lastEvaluationAt` was recorded before `evaluate`. Record the cooldown at presentation or enforce it in delivery; Maximum mode is otherwise unthrottled.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift:2843">
P2: When the user snoozes while a card is visible, the card's existing six-second timer keeps running. If another card arrives before that timer fires, the old timer dismisses the new card and may advance its queue; cancel and replace the old timer, then flush the retained queue explicitly.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextDeliveryAuthority.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextDeliveryAuthority.swift:125">
P3: Removing the snooze branch from `freeGate` leaves the `ContextDeliveryGateReason.snoozed` case with no producer and no consumer; it is now unreachable. Since this enum is not persisted (unlike `TaskInterruptionGateReason`, which must retain `snoozed` for decoding historical gate traces), the orphaned case can be removed.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| now: now, | ||
| lastEvaluationAt: lastEvaluationAt, | ||
| cooldown: cooldown, | ||
| cooldown: SuggestionGatePolicy.cooldown(base: cooldown, frequencyLevel: frequencyLevel), |
There was a problem hiding this comment.
P2: When a Gemini call lasts more than 30 seconds, this permits the next evaluation immediately after the first returns because lastEvaluationAt was recorded before evaluate. Record the cooldown at presentation or enforce it in delivery; Maximum mode is otherwise unthrottled.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Assistants/Suggestions/SuggestionAssistant.swift, line 152:
<comment>When a Gemini call lasts more than 30 seconds, this permits the next evaluation immediately after the first returns because `lastEvaluationAt` was recorded before `evaluate`. Record the cooldown at presentation or enforce it in delivery; Maximum mode is otherwise unthrottled.</comment>
<file context>
@@ -141,12 +147,11 @@ actor SuggestionAssistant: ProactiveAssistant {
now: now,
lastEvaluationAt: lastEvaluationAt,
- cooldown: cooldown,
+ cooldown: SuggestionGatePolicy.cooldown(base: cooldown, frequencyLevel: frequencyLevel),
dwell: dwell,
- requiredDwell: Self.requiredDwell,
</file context>
| } | ||
|
|
||
| /// Hide the bar and suppress notifications for the given duration. | ||
| /// Hide the bar for the given duration. This is a statement about the BAR only: |
There was a problem hiding this comment.
P2: When the user snoozes while a card is visible, the card's existing six-second timer keeps running. If another card arrives before that timer fires, the old timer dismisses the new card and may advance its queue; cancel and replace the old timer, then flush the retained queue explicitly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/FloatingControlBar/FloatingControlBarWindow.swift, line 2843:
<comment>When the user snoozes while a card is visible, the card's existing six-second timer keeps running. If another card arrives before that timer fires, the old timer dismisses the new card and may advance its queue; cancel and replace the old timer, then flush the retained queue explicitly.</comment>
<file context>
@@ -2840,21 +2840,14 @@ class FloatingControlBarManager {
}
- /// Hide the bar and suppress notifications for the given duration.
+ /// Hide the bar for the given duration. This is a statement about the BAR only:
+ /// notifications keep flowing and present via the temp-show path (card pops over the
+ /// hidden bar, then the bar re-hides). It used to also drop the queue and gate all
</file context>
| @@ -0,0 +1,3 @@ | |||
| { | |||
| "change": "At Maximum notification level, nudges arrive within ~10 seconds of switching into an app and can repeat every 30 seconds; Balanced and below keep the usual pace" | |||
There was a problem hiding this comment.
P3: The changelog fragment must start with "Fixed", "Added", "Improved", or "Changed", per the changelog fragment rules in AGENTS.md, but it currently begins with "At Maximum notification level". Change it to start with one of those verbs, e.g. "Changed: At Maximum notification level, nudges arrive within ~10 seconds ...".
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/changelog/unreleased/20260814-maximum-level-fast-nudges.json, line 2:
<comment>The changelog fragment must start with "Fixed", "Added", "Improved", or "Changed", per the changelog fragment rules in AGENTS.md, but it currently begins with "At Maximum notification level". Change it to start with one of those verbs, e.g. "Changed: At Maximum notification level, nudges arrive within ~10 seconds ...".</comment>
<file context>
@@ -0,0 +1,3 @@
+{
+ "change": "At Maximum notification level, nudges arrive within ~10 seconds of switching into an app and can repeat every 30 seconds; Balanced and below keep the usual pace"
+}
</file context>
| static func freeGate(input: ContextDeliveryGateInput) -> ContextDeliveryGateReason { | ||
| if !input.masterEnabled { return .masterDisabled } | ||
| if input.frequencyLevel == 0 { return .frequencyDisabled } | ||
| if input.snoozed { return .snoozed } |
There was a problem hiding this comment.
P3: Removing the snooze branch from freeGate leaves the ContextDeliveryGateReason.snoozed case with no producer and no consumer; it is now unreachable. Since this enum is not persisted (unlike TaskInterruptionGateReason, which must retain snoozed for decoding historical gate traces), the orphaned case can be removed.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/ProactiveAssistants/Core/ContextDeliveryAuthority.swift, line 125:
<comment>Removing the snooze branch from `freeGate` leaves the `ContextDeliveryGateReason.snoozed` case with no producer and no consumer; it is now unreachable. Since this enum is not persisted (unlike `TaskInterruptionGateReason`, which must retain `snoozed` for decoding historical gate traces), the orphaned case can be removed.</comment>
<file context>
@@ -4,7 +4,6 @@ import Foundation
struct ContextDeliveryGateInput: Equatable, Sendable {
let masterEnabled: Bool
let frequencyLevel: Int
- let snoozed: Bool
let paywalled: Bool
let cooldownSeconds: TimeInterval
let dailyLimit: Int
@@ -13,15 +12,13 @@ struct ContextDeliveryGateInput: Equatable, Sendable {
init(
</file context>
…cus-nudge cadence (+ context-buckets starvation fix) (#11562) ## What Nik's demo spec for the **Maximum** notification level: open TikTok/X → focus nudge in **<10 seconds**; keep the feed open → another nudge **under every half minute**, indefinitely. This PR makes level 5 deliver that, verified with 10 consecutive live trials on a real TikTok feed, while every calmer level stays byte-identical (test-pinned). Stacked on the context-buckets starvation fix (supersedes #11554 — same commits included; that PR will be closed on merge). `SuggestionPacing` is the single surface where Maximum may differ: - dwell 4s (30s elsewhere), settle 2s (6s), cooldown capped 20s (180s), confidence bar capped 0.65, dedup memory 0 (10 — the user asked to be nagged repeatedly), daily evaluation budget 600 (40) - context re-arms after an eligible evaluation (calm levels stay one-shot per arrival) - fresh context waives leftover cooldown (same-context repeats stay paced; anchor-vs-lastEvaluation ordering makes this safe) - capture: full frame every base heartbeat (no preview-similarity skip/backoff), and the idle window extends to 300s — including inside `ProactiveCaptureTrigger`'s own idle check (reviewer-caught bypass, now with a behavioral test at idleSeconds=120) Merged #11553's 10s-dwell/30s-cooldown values are superseded by this newer spec; its hide/re-hide and no-snooze-gate behavior is preserved. `SuggestionGatePolicy.requiredDwell/cooldown` now delegate to `SuggestionPacing`. ## Product invariants None matched (`scripts/pr-preflight --suggest`). Failure-Class: none ## Verification - Pinned-value tests: `SuggestionPacingTests` (Maximum values + every calm level's 30/6/180/0.85/10/40 asserted level-by-level; caps never raise user-configured values; idle-override behavioral test; heartbeat/re-arm/waiver policy tests). Focused suites green; changed #11553 expectations (10s→4s, 30s→20s) cite Nik's explicit spec: "receive a notification almost immediately in <10 seconds… every <30 seconds". - **Live 10-trial marathon** (omi-ankara from this branch, real signed-in account, real TikTok feed window frontmost, Maximum): first delivery per trial = 1.1, 7.2, 7.2, 2.1, 2.0, 1.0, 3.2, 7.3, 6.1, 1.1 s — **10/10 under 10s**. Inter-delivery gaps while the feed stayed open: 27/28 under 30s (5–26s), one 49s gap from a single below-bar evaluation. Up to 4 deliveries per 65s hold. - `.cross-review-verify.png`: live floating-bar nudge card ("Suggested by Omi …") captured seconds after delivery on this build. - Earlier iterations' failures that shaped the design are in the commit messages (one-shot context consume, preview-similarity starvation, cooldown carry-over, trigger idle bypass). Line-Count-Exception: desktop/macos/Desktop/Sources/ProactiveAssistants/ProactiveAssistantsPlugin.swift | 1761 -> 1773 | 12 lines wiring the level-aware idle threshold and forced-heartbeat flag into the two capture-gate call sites; the policy itself lives in SuggestionPacing (SuggestionModels.swift), splitting these call sites out would separate a gate check from the loop that owns it <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/11562?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. -->
…etector (unblocks beta train) (#11565) ## What Unblocks the desktop beta train. Every `desktop_auto_release` run since 06:38Z fails because Release Eligibility re-runs the line-count ratchet on main commits **without** the merged PR's body exception (filed as #11564) — so #11553's and #11556's legitimate, PR-lane-approved exceptions poison eligibility on their merge commits and no candidate can cut. This folds #11556's 18 gate-site lines out of `ProactiveAssistantsPlugin.swift` (1779 → 1767) into `MediaPlaybackDetector`, where the exemption policy and cache already live. A shrinking commit passes the ratchet statelessly, so eligibility on this commit (and descendants) goes green and the hourly train cuts again. Behavior is identical: `effectiveIdleSeconds(hidIdleSeconds:threshold:)` on the detector wraps the same pure policy and keeps the once-per-episode log. ## Product invariants None matched (path-based check: none). ## Verification - Re-verified live on the rebuilt omi-notch bundle from this branch: `05:01:29 CaptureGate: HID-idle but media playback active — capture continues` with the user genuinely HID-idle 45 min and a real `PreventUserIdleDisplaySleep` assertion held (screenshot in worktree). - `MediaPlaybackIdleExemptionTests` 4/4 — adds `testDetectorEffectiveIdleMatchesPolicy` proving the gate-facing wrapper mirrors the pure policy. - Debug build clean; pinned swift-format applied. <!-- This is an auto-generated description by cubic. --> <a href="https://cubic.dev/pr/BasedHardware/omi/pull/11565?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. -->
What
Four verified fixes/features for proactive notifications, driven by tonight's live debugging with Nik:
omi.log: 9snoozedsuppressions in one movie hour). The hide state is structurally removed from every delivery gate —sendNotification,showNotification,ContextDeliveryGateInput,TaskInterruptionEnvironment,SuggestionGatePolicyno longer accept a snoozed input (compiler-enforced). Cards present via the existing temp-show path over the hidden bar.isEnabled == true, so the re-hide indismissNotificationAndAdvanceQueuemust also arm on the hidden state — otherwise the first nudge brought the bar back for the rest of the window (peer-review finding).kodjima33/buckets-starve-suggestions(credited in the commit): with the PostHog flag at 100%,SuggestionAssistant.isEnabledreturned false on every fresh sign-in and focus nudges went silent fleet-wide; observed live on this account ("disabled" probe outcome at 02:24).Product invariants
NotificationService.swift); transcript behavior unchanged, only the snooze suppression gate is removed.FloatingControlBarWindow.swift,FloatingControlBarView.swift); voice-turn lifecycle untouched; bar-visibility policies still honor the hidden state for the bar itself.Failure-Class: none
Line-Count-Exception: desktop/macos/Desktop/Sources/ProactiveAssistants/ProactiveAssistantsPlugin.swift | 1755 -> 1761 | the level-aware distribution fallback replaces a one-line constant with a documented computed property; the policy logic itself lives in ProactiveAssistantOrchestrationPolicy (tested there), only the 6-line accessor lands in the plugin
Verification (all live on named bundles, real signed-in account, Maximum level)
floatingBar_snoozedUntilset 2 h ahead — the exact state that returned six consecutivesnoozedprobe outcomes on the previous build —probe_suggestion_nudgedelivered AND spoke (01:24:18 log:Suggestion: delivering [90%]…→NotificationSpeech: speaking…).disabledon fresh sign-in with the flag at 100%; after — delivered.