Skip to content

feat(vscode): add attention sounds - #11098

Merged
marius-kilocode merged 6 commits into
mainfrom
feat/vscode-attention-notifications
Jun 15, 2026
Merged

feat(vscode): add attention sounds#11098
marius-kilocode merged 6 commits into
mainfrom
feat/vscode-attention-notifications

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

The VS Code extension does not currently provide an audible signal when work finishes or requires input. This is especially noticeable in Agent Manager, where several local or worktree sessions can run in parallel while the user edits elsewhere.

This adds one extension-wide attention service over the shared CLI event stream. It handles session completion, subagent completion, questions, permission requests, errors, request deduplication, and reconnect resets consistently across sidebar sessions, editor tabs, and Agent Manager sessions.

Sound notifications are disabled by default and controlled by one opt-in switch. Users can keep the default event-specific sounds, choose the system sound, or select one bundled sound for every event. Playback uses platform-native audio commands on macOS, Linux, and Windows.

image

Comment thread packages/kilo-vscode/src/services/attention/attention.ts Outdated
Comment thread packages/kilo-vscode/src/services/attention/sound.ts
@kilo-code-bot

kilo-code-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Previous Issues Status

File Line Issue Status
packages/kilo-vscode/src/services/attention/sound.ts 68 chain/queued module-level mutable state not reset on AttentionService.dispose() 📌 Carried forward (unchanged in this diff)
packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx errorSound SettingsRow missing last prop ✅ Resolved (component rewritten)
packages/kilo-vscode/src/services/attention/attention.ts Subagent permission and question requests warning ✅ Resolved (file refactored)
Incremental Update (a4b9676 → HEAD)

This PR adds a user-selectable sound dropdown next to the attention toggle:

  • sound.ts — Added CustomSoundIDs array (45 bundled sounds), resolveSoundID() validator, systemCommands() for platform-native beep, and AttentionSoundID type. playSound() now accepts selected: AttentionSoundID. perform() routes to systemCommands() when "system" is selected, or resolves file path from id.
  • service.tspreviewSound(value) resolves sound ID before passing to playSound. notify() reads attention.sound config and resolves ID per call. resolveSoundID imported from sound.ts.
  • NotificationsTab.tsx — Added SOUND_OPTIONS array (default, system, 45 custom sounds via groups). Replaced standalone toggle card with toggle + Select dropdown + Test button. disabled={!enabled()} on both controls. Test button sends sound value through testNotification message.
  • KiloProvider.tssendNotificationSettings() includes attentionSound. previewSound(message.sound) passes sound value.
  • extension-messages.ts / webview-messages.ts — Added attentionSound: string to settings and sound: string to test notification.
  • package.json — Added kilo-code.new.attention.sound with enum of all 47 values.
  • attention.test.ts — Updated to verify sound config defaults, enum, resolveSoundID fallback, and that all CustomSoundIDs have bundled wav files.
  • 18 i18n files — Added settings.notifications.sound.system, settings.notifications.sound.description keys.

Design notes:

  • When a custom sound is selected (e.g. "alert-04"), all attention events use that single wav file. When "default" is selected, each event maps to a different sound via the files record. When "system" is selected, platform commands produce the OS beep.
  • resolveSoundID safely falls back to "default" for unrecognized values, providing a defense-in-depth layer against bad config.
  • The chain/queued serialization and queue-limit mechanism is unchanged — playSound is still fire-and-forget with module-level chain management.
Files Reviewed (26 files)
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/services/attention/service.ts
  • packages/kilo-vscode/src/services/attention/sound.ts
  • packages/kilo-vscode/tests/unit/attention.test.ts
  • packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ar.ts
  • packages/kilo-vscode/webview-ui/src/i18n/br.ts
  • packages/kilo-vscode/webview-ui/src/i18n/bs.ts
  • packages/kilo-vscode/webview-ui/src/i18n/da.ts
  • packages/kilo-vscode/webview-ui/src/i18n/de.ts
  • packages/kilo-vscode/webview-ui/src/i18n/en.ts
  • packages/kilo-vscode/webview-ui/src/i18n/es.ts
  • packages/kilo-vscode/webview-ui/src/i18n/fr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/it.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ja.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ko.ts
  • packages/kilo-vscode/webview-ui/src/i18n/nl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/no.ts
  • packages/kilo-vscode/webview-ui/src/i18n/pl.ts
  • packages/kilo-vscode/webview-ui/src/i18n/ru.ts
  • packages/kilo-vscode/webview-ui/src/i18n/th.ts
  • packages/kilo-vscode/webview-ui/src/i18n/tr.ts
  • packages/kilo-vscode/webview-ui/src/i18n/uk.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zh.ts
  • packages/kilo-vscode/webview-ui/src/i18n/zht.ts
Previous Review Summaries (2 snapshots, latest commit a4b9676)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit a4b9676)

Status: No New Issues | Recommendation: Merge

Previous Issues Status

File Line Issue Status
packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx errorSound SettingsRow missing last prop ✅ Fixed — last is now present at NotificationsTab.tsx:28
packages/kilo-vscode/src/services/attention/sound.ts 16-17 chain/queued module-level mutable state not reset on AttentionService.dispose() 📌 Carried forward (file unchanged in this diff)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/src/services/attention/sound.ts 16-17 Module-level chain/queued mutable state not reset on AttentionService.dispose()
Incremental update (5ebd5fe → HEAD)

This commit simplifies the notifications UI from individual per-category sound pickers to a single attention.enabled master toggle:

  • NotificationsTab.tsx — Complete rewrite: replaced the three per-category pickers (agent/permissions/errors) with a single Switch toggle for attention.enabled plus a "Test" button that sends testNotification.
  • Settings.tsx<h3> heading changed from settings.notifications.sounds to settings.notifications.title to match the simplified scope.
  • extension-messages.tsNotificationSettingsLoadedMessage simplified from 6 fields to just attentionEnabled: boolean.
  • webview-messages.tsTestNotificationMessage removed settingType and sound fields (no longer needed).
  • All 18 i18n locale files — Added settings.notifications.enable.title, settings.notifications.enable.description, and settings.notifications.testSound keys. These are correctly referenced in NotificationsTab.tsx.

Previous last prop SUGGESTION resolved — The new NotificationsTab.tsx correctly includes last on its now-single SettingsRow.

Overall observations

Clean simplification. The master toggle approach is simpler for users and reduces config surface. The previewSound() handler on the extension side correctly calls playSound("default") without needing per-category parameters. The sendNotificationSettings() method in KiloProvider.ts correctly sends only attentionEnabled.

Remaining suggestion: The sound.ts module-level chain/queued state is still not reset on AttentionService.dispose(), which could lead to stale queued counts across service lifecycles.

No memory leaks detected in the new code.

Files Reviewed (23 files)
  • packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx — rewritten (previous last SUGGESTION fixed)
  • packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx — heading changed
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts — simplified
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts — simplified
  • packages/kilo-vscode/webview-ui/src/i18n/*.ts (18 locale files) — added 3 new keys
  • packages/kilo-vscode/src/services/attention/sound.ts — unchanged (carried forward)

Fix these issues in Kilo Cloud

Previous review (commit 5ebd5fe)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/src/services/attention/sound.ts 67 Module-level chain/queued mutable state is not reset on AttentionService.dispose()
packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx 148 errorSound SettingsRow is the last row in its Card but is missing the last prop — renders an unnecessary bottom border
Incremental update (d80c99b5ebd5fe)

This commit removes the entire visual notification layer (showInformationMessage/showErrorMessage) and strips the AttentionService down to sounds only. Key changes:

  • service.ts — Removed delivery() usage, appFocused tracking, focus disposable, clean() helper, and all VS Code notification popup calls. notify() now exclusively plays sounds gated by ${key}Enabled.
  • attention.ts — Exported delivery() function and DeliveryInput type removed entirely. The subagent field on AttentionNotice and subagent_done kind remain in the tracker but are now unused at the service layer — minor dead code, may be intentional for future use.
  • connection-service.tsisSessionFocused() removed (no longer needed).
  • NotificationsTab.tsx — Visual notifications card section and playWhenFocused row removed. The errorSound row is now unconditionally the last row, reinforcing the existing suggestion to add the last prop.
  • Settings.tsx — Tab <h3> heading changed from settings.notifications.title to settings.notifications.sounds.
  • extension-messages.tsnotifyAgent, notifyPermissions, notifyErrors, playWhenFocused fields removed from NotificationSettingsLoadedMessage.
  • All i18n files — Visual notification strings and playWhenFocused strings removed consistently across all 20 locales.
  • Previous WARNING resolved: The warning about subagent question/permission notices being visually suppressed is now moot — visual notifications were removed by design.
Overall observations

Clean simplification. Removing the visual notification layer eliminates the delivery() policy function entirely, making the service trivially simple and easier to reason about. The three-layer split (AttentionTracker → events, AttentionService → sound dispatch) remains clean.

subagent dead code: AttentionNotice.subagent is populated by AttentionTracker but never read in service.ts. subagent_done kind is also unused beyond mapping to the "agent" sound config. These are harmless and may be kept for future use.

No memory leaks detected in the service lifecycle — the focus disposable removal was safe since appFocused tracking is no longer needed.

Files Reviewed (17 files)
  • packages/kilo-vscode/src/services/attention/attention.ts (updated) — previous WARNING resolved
  • packages/kilo-vscode/src/services/attention/sound.ts — 1 suggestion (carried forward)
  • packages/kilo-vscode/src/services/attention/service.ts (updated)
  • packages/kilo-vscode/src/services/attention/index.ts
  • packages/kilo-vscode/src/KiloProvider.ts (updated)
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/src/services/cli-backend/connection-service.ts (updated)
  • packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx (updated) — 1 suggestion (carried forward)
  • packages/kilo-vscode/webview-ui/src/components/settings/Settings.tsx (updated)
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts (updated)
  • packages/kilo-vscode/tests/unit/attention.test.ts (updated)
  • packages/kilo-vscode/tests/unit/kilo-provider-load-messages.test.ts (updated)
  • .changeset/notify-background-sessions.md (updated)
  • packages/kilo-vscode/package.json
  • i18n locale files (20 files) (updated)

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4-pro-20260423 · 453,490 tokens

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/webview-ui/src/components/settings/NotificationsTab.tsx Outdated
@marius-kilocode marius-kilocode changed the title feat(vscode): add attention notifications feat(vscode): add attention sounds Jun 12, 2026
@marius-kilocode
marius-kilocode merged commit 884c54f into main Jun 15, 2026
21 checks passed
@marius-kilocode
marius-kilocode deleted the feat/vscode-attention-notifications branch June 15, 2026 14:12
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…-notifications

feat(vscode): add attention sounds
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.

2 participants