Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

A finish or an error stays quiet while the session's terminal is in front

Orlando Castañeda9e9573299274
diff --git a/NotchBuddy/Sources/App/HookServer.swift b/NotchBuddy/Sources/App/HookServer.swift
index 3d6c37b0..5daf675b 100644
--- a/NotchBuddy/Sources/App/HookServer.swift
+++ b/NotchBuddy/Sources/App/HookServer.swift
@@ -469,6 +469,11 @@ final class HookServer: @unchecked Sendable {
}
let focused = state.focusId == agentId
+ // The user is looking at the session's terminal: a finish or an error is already in
+ // front of them, so the pill only takes a badge (no sound, no reveal). Warp exposes
+ // no active tab, so a sibling session in another tab of the same terminal is quiet too.
+ let terminalInFront = hostApp != nil
+ && NSWorkspace.shared.frontmostApplication?.bundleIdentifier == hostApp
// Several sessions can share one pill (it is chosen from the client, not from the
// session). The registry tells a turn-ending event whether it may touch the pill,
// and which session owns the project name shown on it.
@@ -602,8 +607,8 @@ final class HookServer: @unchecked Sendable {
if !finalText.isEmpty, let idx = state.tasks.firstIndex(where: { $0.id == agentId }) {
state.tasks[idx].finalLine = finalText
}
- SoundEngine.shared.play("finish")
- if focused {
+ if !terminalInFront { SoundEngine.shared.play("finish") }
+ if focused && !terminalInFront {
expandIfNeeded(to: .finished)
} else {
setPillBadge(id: agentId, badge: .finished)
@@ -623,8 +628,8 @@ final class HookServer: @unchecked Sendable {
RecapStore.shared.stop(sessionId: recapSessionId)
guard sessions.endTurn(pill: agentId, session: sessionId) == .pill else { break }
state.updateTask(id: agentId, state: .error)
- SoundEngine.shared.play("error")
- if focused {
+ if !terminalInFront { SoundEngine.shared.play("error") }
+ if focused && !terminalInFront {
expandIfNeeded(to: .error)
} else {
setPillBadge(id: agentId, badge: .error)