Skip to content

Feature request: play a sound when the agent asks a question (question.asked) #49371

Closed as not planned

Description

@frediaform-hub

Summary

The desktop app's Sound effects settings cover three events: Agent (turn finished, session.idle), Permissions (permission.asked), and Errors. There is no sound for the fourth "attention required" event: when the agent uses the question tool and waits for the user's answer (question.asked). The user gets (at best) a desktop notification and an in-app toast, but no audio — so the question is easily missed when working in another window.

Use case

The ask-user flow is a core interaction: the agent blocks until the user answers. In practice I routinely switch to another window while the agent works (long tasks, builds). When the agent then asks a question:

  • the turn-finished sound does not play (the session is not idle — it is waiting),
  • there is no sound at all,

so the agent can sit blocked for many minutes while I have no idea it needs me. This is precisely the situation the existing sounds were designed for ("play a sound when the agent finishes or requires attention"), and questions are the one attention-required event with no audio.

Investigation already done (desktop app v1.18.30, asar examined)

While building a local patch for myself, I mapped how sound playback is wired:

  1. The sound Agent is played in a handler listening on the global SDK event stream, but only for event.type === "session.idle". This same global listener never receives question.asked (verified at runtime with a Chrome DevTools Protocol listener: session.idle arrives, question.asked does not).
  2. question.asked is handled on a different path: the parallel sync-store reducer (case "question.asked" with data.question[...] / setData(...)), which is what actually renders the question UI.
  3. The useSDKNotificationToasts handler (the one with the question.asked branch that plays the desktop notification + toast) is not mounted at startup — its module top-level never runs until some later point (verified: window listeners registered there are absent), so anything wired only into that handler can miss questions too.
  4. Playing new Audio(...) from the renderer works reliably once the user has interacted with the window (no autoplay-policy issue).

I ended up patching the asar to call an audio play directly inside the question.asked case of the parallel reducer (data), which works: I now hear a sound every time the agent asks me something.

Suggested implementation

Add a fourth sound channel to the settings, mirroring the existing three:

sounds: {
  agentEnabled: true,
  agent: "staplebops-01",
  permissionsEnabled: true,
  permissions: "staplebops-02",
  errorsEnabled: true,
  errors: "nope-03",
  questionsEnabled: true,      // new
  questions: "alert-01"        // new
}
  • New "Questions" row in Settings → Sound effects (same SOUND_OPTIONS list), with a matching settings.general.sounds.questions translation key.
  • Play it wherever the app processes question.asked on the real-time path (the parallel reducer branch, or any handler that is guaranteed to receive question.asked — note again that the global SDK listener used for session.idle does not receive this event in my testing).
  • Keep a per-session anti-spam cooldown similar to the existing notification cooldown (alertedAtBySession), so a question plays one sound, not a chorus.

Why I cannot work around this myself (cleanly)

The settings store is not reachable from the plugin API, and the only reliable injection point for this event is deep in the renderer bundle — so the clean fix has to be native. My own workaround required patching app.asar (re-applied after every app update), which is not something I want to maintain long-term, and other users cannot do it at all.

Environment

  • App: opencode desktop v1.18.30
  • OS: Linux Mint 22.3
  • File examined: /opt/OpenCode/resources/app.asar
  • Relevant code locations (textual anchors; offsets shift between versions):
    • Sound settings UI + SOUND_OPTIONS list (renderer bundle, search SOUND_OPTIONS)
    • Default settings block: sounds: { agentEnabled: true, agent: "staplebops-01", ... }
    • Global SDK listener playing the Agent sound for session.idle (search handleSessionIdle)
    • useSDKNotificationToasts handler: permission.asked plays a sound, question.asked only calls platform2.notify
    • Real-time reducer: case "question.asked" in the parallel store (data.question[question.sessionID])

Acceptance criteria

  • A "Questions" sound setting exists (enabled + sound id), consistent with Agent/Permissions/Errors.
  • A sound plays when the agent asks a question, whether the session is focused or in the background.
  • A question plays the sound once (cooldown respected), and answering/dismissing it stops any further alerting for that question.
  • The existing three sound behaviors are unchanged.

Thanks for considering this.

Activity

  1. github-actions commented on Sep 16, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Both cover the same core gap — no audio alert when the agent is waiting for the user's answer — that this issue describes.

  2. frediaform-hub commented on Sep 17, 2026

    @frediaform-hub
    Author

    Confirming this is not a duplicate of the two referenced issues:

    What #49371 requests is different and not covered by either: the desktop app itself should play a (user-selectable) sound natively when the agent asks a question (question.asked). There is currently no sound path in the desktop app for that event, and the TUI plugin workaround doesn't apply to the desktop client.

  3. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed request and for working through the asar code yourself.

    You're on the desktop app v1.18.30. That's OpenCode v1, which only gets fixes for critical bugs such as data loss, crashes or security problems, so this is unlikely to change in v1. Development now happens in v2 (npm package @opencode/cli, opencode command), and we encourage upgrading.

    In v2 this is being worked on, but nothing has been released yet. These are the related issues and PRs, most relevant first:

    If this also happens on v2 after those changes, or you believe it's critical, please reply here.

  4. opencodejr commented on Oct 29, 2026

    @opencodejr

    We haven't heard back, so I'm closing this as not planned. This request is for the v1 desktop app (v1.18.30), and v1 only gets critical fixes. A separate sound for agent questions is a feature, not a critical bug.

    In v2, question alerts are being worked on in #56044 (open PR that plays the Permissions sound for question.asked). For v2, see also #59779 (no system notification for pending questions) and #41355 (configurable per-event sounds). If you upgrade to v2 and it still doesn't alert you when the agent asks a question, please open a new issue with your v2 version. Thanks again for the thorough write-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions