Uh oh!
There was an error while loading. Please reload this page.
feat(web): add turn completion sound with settings toggle - #7066
feat(web): add turn completion sound with settings toggle#7066kbrianps wants to merge 6 commits into
Conversation
- Generate a subtle two-tone completion chime via Web Audio API when an agent completes a turn. - Add soundNotificationsEnabled setting in ClientSettings and General settings panel. Gemini 3.7 Flash via Antigravity CLI
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit ae62109. Configure here.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ApprovabilityVerdict: Needs human review This PR introduces a new user-facing feature (turn completion sounds) that is enabled by default for all users. New features introducing runtime behavior changes warrant human review to validate the user experience and default settings choices. You can customize Macroscope's approvability policy. Learn more. |
…ydration - Avoid false chimes on initial snapshot and environment hydration. - Ignore mid-turn checkpoint events while state/session is running. Gemini 3.7 Flash via Antigravity CLI
Uh oh!
There was an error while loading. Please reload this page.
- Clear completion tracker state when a thread is archived. - Prevent stale chimes upon unarchiving already-settled threads. Gemini 3.7 Flash via Antigravity CLI
There was a problem hiding this comment.
Effect service conventions: no Effect service definitions, layers, or runtimes are introduced or consumed by this PR, so the service/error/runtime rules do not apply. Three change-discipline violations remain: explanatory comments documenting existing invariants were deleted in files touched for unrelated reasons.
Posted via Macroscope — Effect Service Conventions
| // Rollback restores the base preference first (which clears any mix) and | ||
| // then re-applies the captured mix on top, so no failure path can leave | ||
| // the pair of keys half-restored. | ||
| const previousHalves = liveHalves; |
There was a problem hiding this comment.
The comment explaining the rollback ordering invariant (base preference first, then re-apply the captured mix) was removed although the logic is unchanged. Consider restoring it.
| constpreviousHalves=liveHalves; | |
| // Rollback restores the base preference first (which clears any mix) and | |
| // then re-applies the captured mix on top, so no failure path can leave | |
| // the pair of keys half-restored. | |
| constpreviousHalves=liveHalves; |
Posted via Macroscope — Effect Service Conventions
| let previousTheme = theme; | ||
| try { | ||
| previousTheme = readThemePreference(); | ||
| } catch { | ||
| // Storage is unreadable; the render-time value is the best rollback. | ||
| } | ||
| // The mix may have changed while the confirmation dialog was open; both | ||
| // the dirty check and the rollback must see the live value. | ||
| } catch {} |
There was a problem hiding this comment.
These comments document invariants of the restore flow (why preferences are re-read after the dialog, and why an unreadable storage falls back to the render-time value) and are unrelated to the sound settings this PR adds. Consider restoring them.
| letpreviousTheme=theme; | |
| try{ | |
| previousTheme=readThemePreference(); | |
| }catch{ | |
| // Storage is unreadable; the render-time value is the best rollback. | |
| } | |
| // The mix may have changed while the confirmation dialog was open; both | |
| // the dirty check and the rollback must see the live value. | |
| }catch{} | |
| // Only touch the theme keys that are actually dirty, so a theme-storage | |
| // failure cannot block restoring unrelated settings. Preferences are | |
| // re-read after the confirmation dialog: they may have changed (another | |
| // tab, an OS flip) while it was open, and rollback must restore the live | |
| // values rather than the ones captured at render time. | |
| letpreviousTheme=theme; | |
| try{ | |
| previousTheme=readThemePreference(); | |
| }catch{ | |
| // Storage is unreadable; the render-time value is the best rollback. | |
| } | |
| // The mix may have changed while the confirmation dialog was open; both | |
| // the dirty check and the rollback must see the live value. |
Posted via Macroscope — Effect Service Conventions
| * A user-chosen font family (a single name or a comma-separated list). Empty | ||
| * means "use the app default"; clients compose their own fallback stacks. | ||
| */ | ||
| export const FontFamilyPreference = Schema.String.check(Schema.isMaxLength(200)); |
There was a problem hiding this comment.
The FontFamilyPreference doc comment specifying that an empty value means "use the app default" was deleted while adding the unrelated sound schemas. Consider keeping it.
| exportconstFontFamilyPreference=Schema.String.check(Schema.isMaxLength(200)); | |
| /** | |
| *Auser-chosenfontfamily(asinglenameoracomma-separatedlist).Empty | |
| *means"use the app default";clientscomposetheirownfallbackstacks. | |
| */ | |
| exportconstFontFamilyPreference=Schema.String.check(Schema.isMaxLength(200)); |
Posted via Macroscope — Effect Service Conventions
There was a problem hiding this comment.
UI consistency review found two issues in apps/web/src/components/settings/SettingsPanels.tsx: an unrelated removal of the comments documenting the theme rollback path in useSettingsRestore, and a w-32 width on the two new sound SelectTriggers that the primitive's min-w-36 makes inert and that diverges from the sibling settings selects. Details inline.
Posted via Macroscope — UI Consistency
| let previousTheme = theme; | ||
| try { | ||
| previousTheme = readThemePreference(); | ||
| } catch { | ||
| // Storage is unreadable; the render-time value is the best rollback. | ||
| } | ||
| // The mix may have changed while the confirmation dialog was open; both | ||
| // the dirty check and the rollback must see the live value. | ||
| } catch {} |
There was a problem hiding this comment.
This PR deletes the comments that explained the rollback contract in restoreDefaults (why only dirty theme keys are touched, why the preference/mix are re-read after the confirmation dialog, why the appearance mode is re-read, and why the catch intentionally falls back to the render-time value). That behavior is non-obvious and unrelated to the sound feature, so the removal is collateral. Suggest restoring the comments (including the two further down, before const liveHalves = readThemeHalves(); / needsFollowSystemReset and before rollbackThemeState).
| letpreviousTheme=theme; | |
| try{ | |
| previousTheme=readThemePreference(); | |
| }catch{ | |
| // Storage is unreadable; the render-time value is the best rollback. | |
| } | |
| // The mix may have changed while the confirmation dialog was open; both | |
| // the dirty check and the rollback must see the live value. | |
| }catch{} | |
| // Only touch the theme keys that are actually dirty, so a theme-storage | |
| // failure cannot block restoring unrelated settings. Preferences are | |
| // re-read after the confirmation dialog: they may have changed (another | |
| // tab, an OS flip) while it was open, and rollback must restore the live | |
| // values rather than the ones captured at render time. | |
| letpreviousTheme=theme; | |
| try{ | |
| previousTheme=readThemePreference(); | |
| }catch{ | |
| // Storage is unreadable; the render-time value is the best rollback. | |
| } |
Posted via Macroscope — UI Consistency
| }} | ||
| disabled={!settings.soundNotificationsEnabled} | ||
| > | ||
| <SelectTrigger className="w-32" aria-label="Turn completion sound"> |
There was a problem hiding this comment.
SelectTrigger's default variant already carries w-full min-w-36, and cn/tailwind-merge does not treat w-* and min-w-* as conflicting, so w-32 never takes effect — the trigger still renders at 9rem. It also drops the stacked-mobile full width that every other settings select keeps. Suggest matching the sibling rows so the intended geometry is real and consistent.
| <SelectTriggerclassName="w-32"aria-label="Turn completion sound"> | |
| <SelectTriggerclassName="w-full sm:w-40"aria-label="Turn completion sound"> |
Posted via Macroscope — UI Consistency
| }} | ||
| disabled={!settings.soundErrorNotificationsEnabled} | ||
| > | ||
| <SelectTrigger className="w-32" aria-label="Turn error sound"> |
There was a problem hiding this comment.
Same as the completion select: w-32 is overridden by the primitive's min-w-36 and removes the mobile full-width behavior used by the other settings selects.
| <SelectTriggerclassName="w-32"aria-label="Turn error sound"> | |
| <SelectTriggerclassName="w-full sm:w-40"aria-label="Turn error sound"> |
Posted via Macroscope — UI Consistency
t3dotgg
commented
Aug 28, 2026
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. We are keeping OPEN #3892 as the single review path for turn sounds. We do not need a second implementation of the same setting and playback behavior. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |

Problem
When agents (Codex, Claude, etc.) complete long-running turns, users working across other windows or tasks don't receive an immediate auditory signal indicating that the response has finished and it's their turn to interact.
Solution
playTurnCompletionSound) with no external audio file dependencies.useTurnCompletionSoundhook to automatically play the chime when an agent turn completes.soundNotificationsEnabledsetting toClientSettingsand a toggle in General Settings.Gemini 3.7 Flash via Antigravity CLI
Note
Low Risk
Client-only UX with guarded audio playback and explicit detection rules; default-on chimes are a product change but not a security or data risk.
Overview
Adds audible notifications when agent turns finish, using the Web Audio API (no bundled audio files).
Runtime behavior: A global
useTurnCompletionSoundhook watches all thread shells, tracks per-thread settlement viadetectNewTurnCompletions, and plays a completion or error sound when a turn newly settles. It skips the first snapshot/hydration, mid-turn checkpoints, interrupted/stopped turns, and archived threads; error sounds take priority over completion when both could apply.Sounds:
turnChime.tsexposes multiple completion presets (chime, bell, marimba, pop) and error presets (descending, chord, subtle, buzz).Settings:
ClientSettingsgains toggles and kind fields (both default on). General Settings adds two rows with preset selects, preview buttons, and reset-to-defaults; restore-defaults and settings search include the new options.Wiring:
TurnCompletionSoundSyncin the app root mounts the hook app-wide.Reviewed by Cursor Bugbot for commit af50d46. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add turn completion and error chime sounds with settings controls
playTurnCompletionSoundandplayTurnErrorSoundfunctions in turnChime.ts that synthesize short tones via the Web Audio API with multiple selectable presets (chime, bell, marimba, pop / descending, chord, subtle, buzz).useTurnCompletionSoundhook that tracks per-thread turn state and plays the appropriate sound when a turn completes or errors, mounted globally via __root.tsx.ClientSettingsSchemain settings.ts with four new keys:soundNotificationsEnabled,soundErrorNotificationsEnabled,soundCompletionKind, andsoundErrorKind, all defaulting to enabled.Macroscope summarized af50d46.