feat: add OPENCODE_NO_NOTIFY env var to suppress notifications#2
Open
christophkroeppl wants to merge 1 commit intokdcokenny:mainfrom
Open
feat: add OPENCODE_NO_NOTIFY env var to suppress notifications#2christophkroeppl wants to merge 1 commit intokdcokenny:mainfrom
christophkroeppl wants to merge 1 commit intokdcokenny:mainfrom
Conversation
e86dbf4 to
08dc78c
Compare
Author
|
There's a couple of open issues and PRs on OpenCode tackling plugin management but none allow for disabling a plugin for a single execution. Also this feature is easy enough to remove in the future if oc decides to impl. plugin suppression. |
When opencode is invoked programmatically from an external harness (build orchestrators, CI pipelines, automation tools), desktop notifications are unhelpful and disruptive. Example: worktrunk (wt step commit) calls opencode run to generate commit messages — these sessions send "Ready for review" notifications that are pure noise since no human is waiting for them. Setting OPENCODE_NO_NOTIFY=1 or OPENCODE_NO_NOTIFY=true disables all notification types by returning an empty plugin at init time. This is opt-in — existing behavior is unchanged when the env var is not set.
08dc78c to
8bc0f82
Compare
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.
Problem
When opencode is invoked programmatically from an external harness — build orchestrators, CI pipelines, automation scripts, etc. — desktop notifications are unhelpful and disruptive. No human is watching the process, so the notifications are pure noise.
Example: worktrunk (
wt step commit) callsopencode runto generate commit messages. Each invocation triggers a "Ready for review" desktop notification that interrupts the user even though the process is fully automated and headless.Solution
A single opt-in environment variable
OPENCODE_NO_NOTIFY. When set to"1"or"true", the entire plugin is disabled at initialization — returning{}before any event listeners are registered. This means:Usage