Skip to content
This repository was archived by the owner on Mar 5, 2026. It is now read-only.

v1.0.4 - Notification Batching

Latest

Choose a tag to compare

@FrankieeW FrankieeW released this 26 Jan 14:54

🎯 New Feature: Notification Batching

Reduce email notification frequency by intelligently batching low-priority events.

✨ What's New

Smart Batching System

  • Low-priority events (TODO completed, session idle) are queued instead of sending immediately
  • High-priority events (errors, plan completed) trigger immediate send with queued summary
  • Configurable 5-minute auto-flush window (default: 300000ms)
  • Queue size limit with automatic oldest-item removal (default: 20)

Configuration

{
  "batching": {
    "enabled": false,  // Default: disabled (backward compatible)
    "windowMs": 300000,  // 5 minutes
    "maxQueueSize": 20,
    "highPriorityTriggers": ["errorOccurred", "planCompleted"]
  }
}

Event Priority

  • πŸ”΄ High Priority: session.error, planCompleted β†’ Send immediately + flush queue
  • 🟑 Low Priority: todo.updated (completed), session.idle β†’ Queue and wait

Email Format

  • High-priority emails append summary block with queued notifications
  • Auto-flush sends standalone summary email after windowMs timeout
  • Each queued item shows: event label, subject, timestamp, original HTML body

πŸ”§ Technical Details

Files Modified

  • opencode/task-notifier.ts (285 β†’ 447 lines)
  • opencode/task-notifier.default.jsonc (70 β†’ 91 lines)

Implementation Highlights

  • NotificationQueue class with FIFO removal
  • completedCountBySession tracking prevents duplicate queuing
  • Config validation filters invalid highPriorityTriggers
  • Default enabled: false ensures zero breaking changes for existing users

πŸ“¦ Installation

Homebrew (recommended)

brew upgrade task-notifier

Manual Update

curl -fsSL https://raw.githubusercontent.com/FrankieeW/task-notifier/main/scripts/install.sh | bash -s -- --upgrade

OpenCode Plugin

curl -fsSL https://raw.githubusercontent.com/FrankieeW/task-notifier/main/scripts/install-opencode.sh | bash -s -- --upgrade

πŸš€ Usage

  1. Edit ~/.config/opencode/task-notifier.jsonc
  2. Set "batching": { "enabled": true }
  3. Restart OpenCode
  4. Enjoy reduced email frequency!

πŸ› Bug Fixes

  • None (feature release)

πŸ“ Full Changelog

  • feat(opencode): add notification batching support (327719c)
  • bump: version 1.0.4 (48772bc)

Previous Release: v1.0.3 - HTML email templates