Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

fix(relay): classify the alert-sound channels in both relay policies (#289)

review95aff671f994
diff --git a/CLAUDE.md b/CLAUDE.md
index 17ada9edc..bc0a2fc37 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -3121,7 +3121,8 @@ command-bearing opens; this does not add a human-confirm dialog or change mobile
`customAlertSounds[kind] = {name, stamp}`. Playback decodes the bytes with `decodeAudioData` — no
`<audio>`, so CSP `media-src` is untouched on both surfaces — and **any failure (missing file,
refused read, decode/playback error) falls back to the chime without throwing** (`lib/customSfx.ts`,
- failures not cached). Every `playSfx` caller must pass `customAlertSounds` (source-pinned in
+ read failures and a missing/closed audio context are retried on the next alert; a DECODE failure
+ is cached for that `stamp`, so a new pick is tried afresh). Every `playSfx` caller must pass `customAlertSounds` (source-pinned in
`customSfx.wiring.test.ts`). Server Edition: full — the browser's `<input type=file>` bytes are
stored in the SERVER's data dir. Mobile: N/A (own notification sounds).
- **Status-grouped sessions** — three always-visible sections: **Waiting for your response** maps
diff --git a/src/core/relay/access-policy.ts b/src/core/relay/access-policy.ts
index e09f2527b..49f5156fa 100644
--- a/src/core/relay/access-policy.ts
+++ b/src/core/relay/access-policy.ts
@@ -328,6 +328,10 @@ export const EDITOR_ONLY: ReadonlySet<string> = new Set<string>([
IPC.filesDownloadTicket,
IPC.filesSaveUpload,
IPC.filesSaveCanvasImage,
+ // Custom alert sounds live in the HOST's data dir and replace the host user's own chime.
+ IPC.filesSaveAlertSound,
+ IPC.filesReadAlertSound,
+ IPC.filesClearAlertSound,
// Git: every mutation, plus network, worktree and commit-message (runs an agent CLI) operations.
IPC.gitInit,
IPC.gitClone,
diff --git a/src/core/relay/scoped-guest-policy.ts b/src/core/relay/scoped-guest-policy.ts
index 42a770261..c04f8753b 100644
--- a/src/core/relay/scoped-guest-policy.ts
+++ b/src/core/relay/scoped-guest-policy.ts
@@ -444,6 +444,10 @@ export const SCOPED_REFUSED: ReadonlySet<string> = new Set<string>([
IPC.agentGatewayCredentialStatus,
IPC.agentGatewayCredentialSave,
IPC.agentGatewayCredentialClear,
+ // Custom alert sounds: host-wide files in the host's data dir, owned by no project.
+ IPC.filesSaveAlertSound,
+ IPC.filesReadAlertSound,
+ IPC.filesClearAlertSound,
// The host's debug log spans every project; relay-api.ts keeps `logs` LOCAL.
IPC.logSnapshot,
IPC.logClear,
diff --git a/src/shared/alert-sound.ts b/src/shared/alert-sound.ts
index 77bc64cdc..15b32ca00 100644
--- a/src/shared/alert-sound.ts
+++ b/src/shared/alert-sound.ts
@@ -1,8 +1,8 @@
// Custom sounds for the agent alerts (issue #289). The built-in chimes are synthesized in
// `renderer/lib/sfx.ts`; a user may replace either one with their own audio file.
//
-// The FILE lives in the data dir of the machine that owns the core (`<userData>/sounds/<kind>.<ext>`
-// — see core/alert-sounds.ts), never at the user's original path: in the Server Edition that path
+// The FILE lives in the data dir of the machine that owns the core (`<userData>/sounds/<kind>.sound`,
+// one format-independent name — see core/alert-sounds.ts), never at the user's original path: in the Server Edition that path
// names a disk on another machine. What rides in settings is only the display name and a stamp,
// so every window/client can tell a new pick from the one it already decoded.