GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(push): add self-hosted Web Push for paired devices by Zijian-Wang · Pull Request #58400 · anomalyco/opencode

Conversation

@Zijian-Wang

@Zijian-Wang Zijian-Wang commented Oct 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #58428

Stacked on #58399, which fixes notifications on Android. This PR adds Web Push on top of it.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds opt-in Web Push notifications for paired browsers. The local OpenCode server stores a VAPID key and one subscription per browser installation, encrypts each notification, and sends it directly to the browser vendor's push service. There is no OpenCode relay and no new hosted infrastructure.

The app registers a dedicated worker under /push/<server-key>/ and adds a per-server push switch to Settings → Notifications. The existing Agent, Permissions, Questions, and Errors switches choose which events are pushed.

Payloads contain a localized title, the session route, a tag, and the event kind. They omit prompts, source code, session titles, errors, and tool output. Push endpoints are allowlisted, redirects are rejected, and a 404/410 response removes the subscription.

I opened #58428 for design approval and am keeping this as a draft until it gets a decision.

How did you verify your code works?

  • bun run check (34/34 tasks)
  • bun run generate in packages/client (no diff)
  • bun run probe:workerd in packages/server
  • bun test test/push.test.ts in packages/server (5 passed)
  • App unit tests: 19 passed; browser notification state: 4 passed
  • bun run test:service-worker (13 passed, including a stopped-worker push injection)
  • Not verified: live APNs/FCM delivery and physical-device behavior.

Screenshots / recordings

Desktop web app:

Notifications settings with Background push

Mobile portrait (390×844):

Notifications settings on mobile portrait

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Zijian-Wang
fix(app): use service worker notifications on Android
7a56354
Chrome on Android rejects the Notification constructor. Prefer ServiceWorkerRegistration.showNotification when the offline worker is active, add a notification click handler that reopens the matching session, and keep the constructor only as a fallback.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 23, 2026
@opencode-agent opencode-agent Bot mentioned this pull request Oct 23, 2026
fix(app): use service worker notifications on Android #58399
Closed
3 of 6 tasks
Zijian-Wang added 5 commits October 23, 2026 19:10
@Zijian-Wang
fix(app): link notifications to their session on the web
13f5781
@Zijian-Wang
feat(push): add self-hosted Web Push for paired devices
5ab223c
Let a paired browser receive agent, permission, question, and error notifications while the web app is closed. The local server stores VAPID keys and subscriptions, encrypts payloads, and sends them directly to browser push services. No OpenCode-hosted relay is involved.
@Zijian-Wang
docs(push): clarify iOS notification permission timing
132af44
@Zijian-Wang
fix(push): point users to the permission button
a122d7a
@Zijian-Wang
fix(push): request iOS notification permission only from the enable b…
0be8168
…utton
@Zijian-Wang Zijian-Wang mentioned this pull request Oct 23, 2026
[FEATURE]: Web Push notifications for paired browsers #58428
Closed
1 task done
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Oct 23, 2026
@Zijian-Wang
Zijian-Wang force-pushed the web-push branch from 691abb8 to 0be8168 Compare October 23, 2026 11:19
@github-actions

github-actions Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Zijian-Wang
fix(push): use a switch for background push
564c765
@Zijian-Wang Zijian-Wang closed this Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Web Push notifications for paired browsers

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Zijian-Wang
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.