anomalyco / anomalyco/opencode
Allow TUI plugins to suppress attention notifications for internal sessions
@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:
-
Config-based filter: Add a
tui.jsonoption likeattention.excludeTitles: ["opencode-mem capture"]orattention.excludeMetadata: { "opencode-mem.internal": true }that the builtin notifications plugin checks before firing. -
API hook: Expose a
api.attention.shouldNotify(sessionID)hook orapi.attention.filter(predicate)method that plugins can use to register exclusion rules. -
Session metadata convention: The builtin notifications plugin could check
session.metadatafor anotifications: falseorinternal: trueflag and skip those sessions.opencode-memalready setsmetadata: { "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 = trueon its capture sessions:internal-capture-sessions.js - The builtin notifications plugin fires on
session.status→idlefor any session that was previouslybusy, with no metadata check:notifications.ts
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.