Repository navigation
Description
Bug Description
When using the OpenCode Electron desktop app with multiple windows open, notifications are duplicated based on the number of windows. For example, with 3 windows open, a single session completion triggers 3 identical notifications (one per window).
Note: While the same code pattern exists in the Tauri desktop implementation and could potentially be affected, this issue has only been tested and confirmed with the Electron desktop app.
Steps to Reproduce
- Open OpenCode Desktop app (Electron version)
- Open additional windows (right-click on dock/taskbar icon, or use File > New Window if available)
- Start a session in any window and wait for it to complete
- Observe that you receive N duplicate notifications (where N = number of open windows)
Expected Behavior
A single notification should be shown regardless of how many windows are open.
Actual Behavior
Each unfocused window independently creates its own browser Notification object, resulting in multiple duplicate notifications.
Technical Analysis
Root Cause:
In packages/app/src/context/notification.tsx, each window independently listens to globalSDK.event.listen() for session events. When a session.idle or session.error event fires, every window calls platform.notify(), which creates a browser Notification in the renderer process:
Electron Desktop (packages/desktop-electron/src/renderer/index.tsx:176-190):
notify: async (title, description, href) => {
const focused = await window.api.getWindowFocused()
if (focused) return // Only prevents notification in focused window
const notification = new Notification(title, { body: description ?? })
// Other windows still create duplicate notifications
}The focus check only skips the focused window - all other unfocused windows still show notifications.
Tauri Desktop (packages/desktop/src/index.tsx:311-336):
The same pattern exists in the Tauri implementation, though this has not been tested.
Potential Solutions
-
Move notification creation to main process (Recommended):
- Use the main process
NotificationAPI instead of renderer-side browser notifications - Ensures single source of truth for notifications
- Use the main process
-
Implement deduplication in renderer:
- Track recently shown notifications using session ID + timestamp
- Skip if same notification was shown within last X seconds
-
Use a single notification window:
- Designate one window as the "notification owner"
- Other windows skip notification creation
Environment
- OpenCode Desktop version: 1.3.9+
- Platform: Tested on macOS (Electron build)
- Issue confirmed with Electron desktop build
Activity
muzlik-gm commentedon Jul 2, 2026
still not fixed, how long is it gonna take them to fix this single issue!
I'm tired of this!
First we got 5 notifications just for one single Session, and now 4 Concurrent sessions!
When you prompt in one Session, the other 3 are also prompted!
github-actions commentedon Sep 1, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.