Skip to content

Feature Request: Play notification sound when 'question' tool awaits user input #1453

@yhc509

Description

@yhc509

Summary

When the AI uses the question tool to present choices and waits for user input, no notification sound is played. Users may not notice that input is required, especially when multitasking.

Current Behavior

  • ✅ Notification sound plays when the main session becomes idle (task completed)
  • session-notification hook correctly filters out subagent sessions
  • ❌ No distinct notification when question tool is awaiting user selection

Expected Behavior

Play a notification sound (or configurable alert) when the question tool is invoked and waiting for user input. This helps users know immediately when their attention is required.

Technical Context

Looking at the OpenCode SDK's Event types in types.gen.d.ts, there's no dedicated event for "question tool awaiting input". The current session.idle event is used for general idle state detection.

Possible Implementation Approaches

  1. Hook into tool.execute.before/tool.execute.after: Detect when the question tool is called and trigger a notification
  2. New event type: Request OpenCode to emit a specific event like tool.question.awaiting when user input is needed
  3. Leverage existing session.idle: The current implementation should already work if session.idle is emitted when waiting for question input - may need investigation if it's not working

Configuration Suggestion

{
  "notification": {
    "onQuestionAwait": true,  // new option
    "questionSound": "/path/to/sound.wav"  // optional custom sound
  }
}

Environment

  • oh-my-opencode version: 3.1.11
  • Platform: macOS (darwin)

Related

This is separate from the existing session-notification and background-notification hooks which handle task completion notifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions