mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-06-26 05:15:48 +08:00
fix(chat): notify for background permission requests
Permission audio was guarded by the visible session check. Tool approvals in background sessions were therefore silent. Keep banner state session-scoped while playing the existing sound globally.
This commit is contained in:
@@ -270,6 +270,10 @@ export function useChatRealtimeHandlers({
|
||||
|
||||
case 'permission_request': {
|
||||
if (!msg.requestId) break;
|
||||
if (isActionablePermissionRequest({ toolName: msg.toolName })) {
|
||||
void playNotificationSound();
|
||||
}
|
||||
|
||||
if (sid === activeViewSessionId) {
|
||||
const previousPendingPermissionRequests = pendingPermissionRequestsRef.current;
|
||||
if (!previousPendingPermissionRequests.some((request) => request.requestId === msg.requestId)) {
|
||||
@@ -284,13 +288,6 @@ export function useChatRealtimeHandlers({
|
||||
|
||||
pendingPermissionRequestsRef.current = nextPendingPermissionRequests;
|
||||
setPendingPermissionRequests(nextPendingPermissionRequests);
|
||||
|
||||
if (
|
||||
isActionablePermissionRequest({ toolName: msg.toolName })
|
||||
&& !hasActionablePermissionRequests(previousPendingPermissionRequests)
|
||||
) {
|
||||
void playNotificationSound();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sid) {
|
||||
|
||||
Reference in New Issue
Block a user