Repository navigation
Conversation
When an agent run needs a tool approval and the PilotDeck window is in the background, desktop users had no way to know until they switched back, leaving runs stalled indefinitely (fixes OpenBMB#691). Renderer: - add useApprovalWaitingAlert hook observing the pending permission queue of the viewed session; on the idle-to-waiting transition while the window is unfocused it asks the desktop bridge for a native toast + taskbar flash, and clears them when the queue drains - broadcast pilotdeck:approval-waiting with the waiting session ids and prefix the document title ("⚠ Waiting for approval (N)") so the taskbar/alt-tab entry reflects the state; restored on resolve/unmount - AppShellV2 listens for the broadcast and SidebarV2 shows an amber awaiting-approval badge on the session row (highest priority over processing/unread), so the waiting session stays findable after navigating away - degradation: plain-web builds or older desktop builds without the bridge keep the badge + title channels and simply skip the toast Desktop main process: - pilotdeck:approval-waiting / pilotdeck:approval-clear IPC: native Notification (localized zh/en, click focuses the window), taskbar flashFrame, tray tooltip "PilotDeck — Waiting for approval"; window focus ends the flashing episode Tests: 18 new vitest cases for the alert utils and hook; existing SidebarV2/MainAreaV2 suites unaffected.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the desktop app (Windows, but applies cross-platform), when an agent run requests a tool approval, there is no system-level reminder: no Windows toast, no taskbar flash, no tray change, and the sidebar session item shows no "waiting for approval" state. A user who leaves PilotDeck in the background only finds out by manually switching back, leaving the run stalled indefinitely (#691).
Solution (combined toast + flash + badge + title, as suggested in the issue)
Renderer (
ui/):useApprovalWaitingAlerthook (wired intoChatInterfaceV2) observes the session's pending permission queue (pendingPermissionRequests):pilotdeck:approval-waiting(CustomEvent with waiting session ids) and prefixesdocument.titlewith the localized⚠ Waiting for approval(+ count when > 1); both fully restored on resolve or unmount.AppShellV2listens for the broadcast and passes the set toSidebarV2, which shows an amberawaiting-approvalbadge (TriangleAlert icon) on the session row — highest priority over processing/unread — so the waiting session stays findable even after navigating away. Includes optimistic-row fallback for requests that arrive beforesession_created.Desktop main process (
apps/desktop/src/):pilotdeck:approval-waiting/pilotdeck:approval-clearIPC handlers:Notification(localized zh/en, e.g. "An operation is waiting for your approval."), click focuses/opens the window.flashFrame(true/false)on the taskbar.PilotDeck — Waiting for approvalwhile waiting.focusautomatically ends the flashing episode.i18n: en + zh-CN strings for the title prefix and sidebar badge.
Red-line files untouched
ui/src/shared/modelListApi.ts,ProviderCard.tsx,parseModelConfig.ts,catalogProviders.ts,ui/server/routes/config.jsare not modified.Testing
New unit tests (18 cases, all passing):
Coverage includes: unfocused window notifies the bridge exactly once per episode; focused window skips the toast but still badges + titles; queue drain restores title/badge and calls clear only if a notification was raised; unmount mid-waiting restores everything; optimistic session-id fallback; missing bridge degradation.
Regression + lint + typecheck:
Fixes #691