Skip to content

feat: Granular notification control — per-channel toggle with curl suppression #27

@virtualian

Description

@virtualian

Problem

The PAI Algorithm currently executes voice notification curl commands unconditionally at every phase transition (7 curls per Algorithm run). These bash calls:

  1. Produce visible noise in the terminal even when the user doesn't want notifications
  2. Waste execution time when the notification server isn't running or notifications are unwanted
  3. Cannot be selectively disabled — it's all-or-nothing

There is no granular control over notification channels (voice, desktop, etc.).

Proposed Solution

Slash Command Interface

Add a /notification skill with per-channel toggle control:

/notification voice on       # Enable voice (curl) notifications
/notification voice off      # Disable voice notifications — suppresses ALL curl calls
/notification desktop on     # Enable desktop notifications
/notification desktop off    # Disable desktop notifications
/notification status         # Show current notification channel states
/notification all off        # Disable all notification channels
/notification all on         # Enable all notification channels

Settings Persistence

Store notification state in settings.json:

{
  "notifications": {
    "voice": true,
    "desktop": true
  }
}

Curl Suppression Behavior

Critical requirement: When notifications.voice is false, the Algorithm MUST NOT execute the phase-announcement curl commands at all. They should be conditionally gated, not executed-and-ignored.

Current behavior (unconditional):

# Always fires, even when unwanted
curl -s -X POST http://localhost:8888/notify -H "Content-Type: application/json" -d '{"voice_id":"...","message": "Entering the Observe phase"}'

Desired behavior (conditional):

# Only fires when notifications.voice is enabled in settings.json
# When disabled: no curl command appears in output, no execution, zero noise

Implementation Considerations

  • The Algorithm template marks voice curls as [VERBATIM - Execute exactly as written] — this directive would need to become conditional on notification state
  • The /notification command should provide immediate feedback: "Voice notifications disabled. Phase announcement curls will be suppressed."
  • Background agents should respect the same notification settings
  • The notification server (localhost:8888) health check could be part of the status command

Acceptance Criteria

  • /notification voice off suppresses all curl calls to the notification server
  • /notification desktop off suppresses desktop notifications
  • Settings persist across sessions via settings.json
  • /notification status shows current state of all channels
  • No visible curl commands appear in output when voice is disabled
  • Background agents inherit notification settings from parent

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions