Repository navigation
Description
Summary
System notifications do not appear when a session completes or fails in the Android PWA. Chrome on Android rejects the web app's use of the Notification constructor and requires ServiceWorkerRegistration.showNotification().
Environment
- opencode version: 2.0.8
- Device: OnePlus 15
- OS: Android 16
- Browser: Chrome 153.0.0.0
- Terminal: Not applicable (standalone PWA)
- Shell: Not applicable (standalone PWA)
- Install/channel:
https://beta.opencode.ai, installed as a PWA
Reproduction
- Install
https://beta.opencode.aias an Android PWA. - Grant notification permission and enable opencode session notifications.
- Open the PWA from its home-screen icon.
- Start a session and switch to another Android app before it completes.
- Wait for the session to complete.
Expected Behavior
An Android system notification should appear when the session completes or fails. Selecting it should return to the corresponding opencode session.
Actual Behavior
No system notification appears.
The following values were confirmed through remote DevTools:
Notification.permission:granted- Standalone display mode:
true - Service-worker registration:
null
Calling the same notification API used by the web platform produces:
TypeError: Failed to construct 'Notification': Illegal constructor. Use ServiceWorkerRegistration.showNotification() instead.
The failure also reproduced during a controlled session-completion test while the PWA was in the background.
Additional Context
packages/app/src/runtime/platform/web.ts creates notifications with new Notification(...). Chrome on Android does not support this constructor and requires ServiceWorkerRegistration.showNotification().
The generated service worker also has no notificationclick handler, which is required to implement notification click behavior.
There is a separate service-worker installation failure on the current beta deployment:
Fetch API cannot load https://beta.opencode.ai/_assets/__vite-browser-external-2447137e-BvRk9kiK.js. SRI's integrity checks failed.
sw.js:1 Uncaught (in promise) TypeError: Failed to fetch. SRI's integrity checks failed.
The browser reported the resource's computed SHA-256 integrity as:
8swVqH0fwc8XDDvPqJf6xzG3/DAwdGgKhA+t9mMRYQQ=
Because the service worker is not currently registered, showNotification() could not be tested on this deployment.
Activity
AdiY00 commentedon Sep 19, 2026
For what it’s worth, I was able to get
ServiceWorkerRegistration.showNotification()to display a notification using a different service worker, so the API itself works on this device.WolfieLeader commentedon Sep 19, 2026
Had the same issue
balducci22 commentedon Oct 1, 2026
Yeah i'm having a similar issue, with iOS its working fine however with android i'm getting a silenced notification that doesnt pops up on the screen.. any ideas how to solve it?
bilogic commentedon Oct 7, 2026
The PWA installer button does not show on my desktop chrome, are you guys sure it is a PWA?
opencodejr commentedon Oct 28, 2026
Thanks for the detailed report and the DevTools findings.
I couldn't reproduce the notification failure here. It only happens in Chrome on Android, and this sandbox has no Android device or emulator. Desktop Chrome accepts
new Notification(...), so the "Illegal constructor" error doesn't appear there.I did read the code on the latest
dev(62ae125). The web platform'snotify()inpackages/app/src/runtime/platform/web.tsstill usesnew Notification(...)with noServiceWorkerRegistration.showNotification()fallback. The generated service worker (packages/app/vite.pwa.ts,generateSW) still has nonotificationclickhandler. Both match what you describe.The service-worker SRI error didn't happen when I checked.
sw.json beta.opencode.ai currently lists__vite-browser-external-2447137e-BvRk9kiK.jswith the hash of an empty file, and the server returns that file empty, so the two match. If you still see the integrity error, clearing the site data and reinstalling the PWA might tell us whether a cached copy was involved.A maintainer with an Android device will need to confirm the notification problem.
Eslamasabry commentedon Oct 31, 2026
Not a fix for the PWA bug, but if you need notifications today: I'm the author of OpenCode Mobile (unofficial, MIT), an Android app that connects to an OpenCode server and uses normal Android notifications, with Allow once and Reject on permission requests. Repo: https://github.com/Eslamasabry/opencode-mobile-next. Android has to allow notifications for it, and the app's Notifications page has a test button.