Skip to content

Commit 08dc78c

Browse files
feat: add OPENCODE_NO_NOTIFY env var to suppress notifications
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.
1 parent 52f905d commit 08dc78c

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/notify.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,11 @@ async function handleQuestionAsked(
486486
// ==========================================
487487

488488
export const NotifyPlugin: Plugin = async (ctx) => {
489+
// When invoked programmatically from a harness, suppress all notifications
490+
if (process.env.OPENCODE_NO_NOTIFY === "1" || process.env.OPENCODE_NO_NOTIFY === "true") {
491+
return {}
492+
}
493+
489494
const { client } = ctx
490495

491496
// Load config once at startup

0 commit comments

Comments
 (0)