Skip to content

feat(desktop-notification): forward mod toasts to native notifications - #10658

Merged
kyle-sexton merged 4 commits into
mainfrom
host-run/9703-toast-forwarder
Oct 28, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
host-run/9703-toast-forwarder

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #9703

Summary

Adds a hooks module to desktop-notification. It hooks ui.toast and forwards each toast any mod shows as a native notification, then calls next so the toast still shows. The option desktop_notification_forward_toasts_enabled (on by default) turns forwarding off.

A probe ran first (Claude Code 2.1.312, a two-plugin mod test under claude plugin test). A user-tier mod's ui.toast hook heard toasts from mods at the prepend, user and append tiers, and its own. The hooks ran in tier order, and toasts from two senders arrived in the order fired. Not probed: toasts Claude Code raises itself, and a live session.

Fix

  • hooks/register.ts hooks ui.toast. It calls $.ui.notify(text, { title: 'desktop-notification' }) without awaiting it and ignores a rejection, then returns next(e).
  • hooks.json loads the module and widens the Notification matcher to plugin_notification.
  • desktop-notification.sh handles a plugin_notification only when its title is desktop-notification, and sends it through the bell, OSC 9 and OS toast channels. A notification any other mod raises is left alone.
  • plugin.json gets the new option. The README covers forwarding, the probe result and the 2.1.287 floor, and its options table is regenerated.
  • Changelog fragment (minor).

Verification

  • claude plugin test plugins/desktop-notification: 5 of 5 pass. One test shows a second plugin's toast reaching the forwarder, which notifies and calls next. Others show a refused notify still lets the toast show, a mod that echoes notifications as toasts does not loop, and either off switch suppresses forwarding while the toast still shows.
  • hooks/desktop-notification.test.sh: 49 of 49 pass. That includes two new cases: a forwarded toast gets OSC 9, and another mod's plugin_notification stays silent.
  • scripts/check-affected.sh --uncommitted: 13 passed, 5 skipped. scripts/check-affected.sh --tests over the branch: 14 passed, 2 skipped.

Related

Part of #6228.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 28, 2026 08:54
…s (WIP)

Adds a hooks module that hooks ui.toast, raises $.ui.notify with the
title desktop-notification, then calls next so the toast still shows.
Adds the desktop_notification_forward_toasts_enabled option and widens
the Notification matcher to plugin_notification.

Not done: the script branch for plugin_notification, README, generated
options docs, changelog fragment, check-affected run.

Refs: #9703

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…annels

The Notification hook now handles plugin_notification when its title is
desktop-notification, so a forwarded toast reaches the bell, OSC 9 and OS
toast channels; another mod's notification is left alone. Adds the hook
test cases, the README section with the probe result, the regenerated
options table and a changelog fragment.

Refs: #9703

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T13:20:12.183147Z 9261dba PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed e060c879a22356f9cde211ce5765b8c7345bd442: 0 finding(s), 0 as inline comments.

Incremental review of the changes since 9261dba (5 files). I found nothing to flag.

  • register.ts guard: the new early return when the bell, terminal-notify and OS-toast options are all false matches desktop-notification.sh. That script gates each of those three channels separately and sends nothing when all are off, so forwarding in that state would only add Claude Code's own $.ui.notify alert. The two new tests cover both sides: all three off gives no notify and the toast still shows, and one channel left on keeps forwarding.
  • Version floor: the 2.1.295 floor is the same in the changelog fragment, plugin.json and the README. The README now separates the mods-load version (2.1.287) from the $.ui.notify version (2.1.295). I could not verify from the repository that 2.1.295 is the first release with $.ui.notify, or that the changelog anchor resolves. That is the author's claim.
  • Manifest: manifest userConfig.desktop_notification_forward_toasts_enabled: pass. Only the description text changed. The default and the key are unchanged, the setting is read by register.ts, and the fragment's bump: minor fits a new feature.
  • Closing issue feat(desktop-notification): probe ui.toast interception, then forward mod toasts to OS notifications #9703: the criteria are still met. The forwarder test, the off-switch tests and the added channel tests all exist. I ran no tests myself. The verification counts in the PR description are author-claimed.
  • Cost: no billing change.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e060c879a22356f9cde211ce5765b8c7345bd442: 0 finding(s), 0 as inline comments.

Security review (incremental, since 9261dba): no security findings.

critical-findings: 0

What changed and what I read:

  • plugins/desktop-notification/hooks/register.ts adds an early return when all three channel options (bell, terminal_notify, os_toast) are false. This narrows when $.ui.notify is called, so it lets nothing through that the base stopped. The notify text comes from a mod's toast and is passed as data. No command, path or template is built from it, and the fixed title is desktop-notification. The two new tests check both sides of the guard.
  • plugins/desktop-notification/.claude-plugin/plugin.json changes only the description of the desktop_notification_forward_toasts_enabled userConfig key, which is in the inert set. Its default stays true, as before. This is not a guard that widens unchecked action. No hooks, mcpServers, or dependencies fields changed.
  • The README and the .changes entry change the minimum Claude Code version from 2.1.287 to 2.1.295 and add notes on channel suppression and double alerts. They are prose only and contain no instructions that remove or soften a standing control.

manifest description (userConfig desktop_notification_forward_toasts_enabled): pass (inert field, text only).

No trust control, token scope, kill switch or merge hold is touched. Nothing in the five files matches the trusted-path list. Nothing in this change spends beyond prepaid credit or subscription usage, and nothing starts a billed resource, so no hold is set.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9261dba848

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/desktop-notification/README.md Resolved
kyle-sexton and others added 2 commits October 28, 2026 10:40
…ff, and state the 2.1.295 floor

With all three plugin channels off the settings hook sends nothing, so
$.ui.notify was the only alert; the forwarder now returns early. The README
notes the preferredNotifChannel alert $.ui.notify also sends. Forwarding
needs 2.1.295, the first release with $.ui.notify.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 392caef Oct 28, 2026
40 checks passed
@kyle-sexton
kyle-sexton deleted the host-run/9703-toast-forwarder branch October 28, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop-notification): probe ui.toast interception, then forward mod toasts to OS notifications

1 participant