feat(cli): add OS desktop notifications for task completion and errors#27126
Open
PranavAgarkar07 wants to merge 1 commit into
Open
feat(cli): add OS desktop notifications for task completion and errors#27126PranavAgarkar07 wants to merge 1 commit into
PranavAgarkar07 wants to merge 1 commit into
Conversation
- Add OPENCODE_DISABLE_NOTIFICATIONS flag to disable native notifications - Create notify module with notify-send (Linux) and osascript (macOS) support - Show rich notifications in non-interactive mode with prompt, agent/model, and output snippet - Show native notifications on session idle/error in TUI mode
Contributor
|
The following comment was made by an LLM, it may be inaccurate: I found 2 potentially related PRs:
Both of these PRs appear to address desktop/system notifications functionality, which overlaps with the current PR's scope of adding OS notifications for task completion and errors in both CLI and TUI modes. You may want to check if these are closed/merged or if there's any duplicate work being done. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue for this PR
Related features requested in #7242, #13334, #18366 — partially addressed by PR #20963 for TUI mode. This PR complements #20963 by covering the non-interactive
opencode runpath.Type of change
What does this PR do?
When running
opencode run, the session completes silently if you're not watching the terminal. The same happens in the TUI when the window is minimized or on another workspace.This adds native OS desktop notifications (
notify-sendon Linux,osascripton macOS) on session idle and error events. AOPENCODE_DISABLE_NOTIFICATIONSenv flag lets you opt out.Relationship to PR #20963 (built-in TUI system notifications):
app.tsx)run+ TUItui.jsontoggleOPENCODE_DISABLE_NOTIFICATIONSenv flagThe two PRs target different execution paths and touch separate files. #20963 handles the case where you're working in the TUI and step away. This PR handles
opencode run— where you submit a prompt and the session runs in the foreground, completing silently if you tab away.Notification design:
Success:
Error:
How did you verify your code works?
Ran a half-dozen prompts at various lengths through
bun run --conditions=browser ./src/index.ts run "<prompt>"and watched for the notification popup:--continue,--command /help— agent/model tracking works through resume and command pathsScreenshots / recordings
N/A — CLI notifications, no UI change.
Checklist