Skip to content

feat: add OS notifications for completed/failed tasks#976

Open
yehyal wants to merge 10 commits intopingdotgg:mainfrom
yehyal:feat/notifications
Open

feat: add OS notifications for completed/failed tasks#976
yehyal wants to merge 10 commits intopingdotgg:mainfrom
yehyal:feat/notifications

Conversation

@yehyal
Copy link

@yehyal yehyal commented Mar 12, 2026

Summary

Adds OS notifications when a task completes or fails, with a user-facing toggle and a settings test button.

Why

Addresses issue
Notifications are important for backgrounded work. This keeps users in the loop without requiring the app to stay focused.

What Changed

  • Added notification levels (off, important, normal, verbose) to control when OS alerts fire.
  • Emit OS notifications for:
    • Important: approval required, user input required, task failed
    • Normal: important + task completed
    • Verbose: normal + task activity updates (task.started, task.progress)
  • Keep completion notifications separate from activity notifications to avoid duplicates.
  • Add the Settings test notification button.
  • Add/extend unit tests around notification helpers.

Levels are easy to extend by adding new activity kinds or mapping logic in nativeNotifications.ts.

Screenshots / Video

  • settings page
Screenshot 2026-03-16 at 17 17 18
  • Demo video (notification firing):
t3code-preview-notification.mp4

Notes

  • Notifications are only sent when the app is in the background and the toggle is enabled.

Note

Add OS notifications for completed and failed tasks

  • Adds a notificationLevel setting (Off, Important, Normal, Verbose) to AppSettingsSchema, defaulting to Normal.
  • Introduces utility functions in nativeNotifications.ts to detect background state, check/request permission, show notifications, and resolve notification payloads for turn completions and attention-requiring activities.
  • Wires notification dispatch into __root.tsx: when the app is backgrounded, each thread snapshot triggers completion/failure and attention notifications per the user's level, with per-thread deduplication.
  • Adds a Notifications section to _chat.settings.tsx where users can set verbosity, request browser permission, and send a test notification.
  • On desktop (via desktopBridge/nativeApi), notifications are shown regardless of browser permission state.

Macroscope summarized a6d5943.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5a7269f2-8f2d-40a7-a573-137b9da0a437

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 12, 2026
@yehyal yehyal marked this pull request as ready for review March 12, 2026 15:37
@github-actions github-actions bot added the size:L 100-499 changed lines (additions + deletions). label Mar 12, 2026
@yehyal yehyal requested a review from juliusmarminge March 12, 2026 20:16
const previous = lastSessionByThreadRef.current.get(thread.id);

// A completed/failed turn transitions from running with an activeTurnId
// to a session with no active turn and status ready/error.
Copy link
Member

Choose a reason for hiding this comment

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

should also notify on input/approval requested?

also maybe have the setting be more configurable than a boolean flag so users can set more granular levels of when they wanna be notified

Copy link
Author

Choose a reason for hiding this comment

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

I wanted to push out a mvp first for just task status notification, but I can definitely work on adding it for input/approval

can you give me a bit more info regarding fine tuning the notifications? some example scenarios / levels that you want to add

Copy link
Author

Choose a reason for hiding this comment

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

which style do you prefer

image

Codex App current style:
image

Copy link
Author

Choose a reason for hiding this comment

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

I will proceed with the first style, to match the current option styling like with the theme

Copy link
Author

Choose a reason for hiding this comment

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

Verbose Level Preview

Screenshot 2026-03-16 at 16 57 30

@github-actions github-actions bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Mar 16, 2026
@yehyal yehyal requested a review from juliusmarminge March 16, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants