anomalyco / anomalyco/opencode

Allow TUI plugins to suppress attention notifications for internal sessions

Open
#45,343 0 comments 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Aug 26, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Problem

Plugins like opencode-mem create internal background sessions (titled "opencode-mem capture") for structured-output LLM calls. These are top-level sessions (no parentID), so the builtin internal:notifications TUI plugin fires desktop notifications and sounds every time one completes — even though the user never interacted with that session.

Currently there's no way to tell the notifications plugin to skip certain sessions. The only workaround is for a plugin to deactivate("internal:notifications") and re-implement the entire notification logic with a filter, which means the plugin won't benefit from upstream improvements to the notification logic.

Proposed solution

One or more of:

  1. Config-based filter: Add a tui.json option like attention.excludeTitles: ["opencode-mem capture"] or attention.excludeMetadata: { "opencode-mem.internal": true } that the builtin notifications plugin checks before firing.

  2. API hook: Expose a api.attention.shouldNotify(sessionID) hook or api.attention.filter(predicate) method that plugins can use to register exclusion rules.

  3. Session metadata convention: The builtin notifications plugin could check session.metadata for a notifications: false or internal: true flag and skip those sessions. opencode-mem already sets metadata: { "opencode-mem": { internal: true, purpose: "structured-output" } } on its capture sessions — the notifications plugin just doesn't look at it.

Option 3 seems lowest-effort since the metadata is already there.

Context

  • opencode-mem sets metadata["opencode-mem"].internal = true on its capture sessions: internal-capture-sessions.js
  • The builtin notifications plugin fires on session.statusidle for any session that was previously busy, with no metadata check: notifications.ts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.