Skip to content

TUI attention sound plays repeatedly while idle with no events (WSL2) #40882

Closed as not planned

Description

@sheng-888

Description

When a session is idle — no prompts, no tool calls, no permission requests —
the TUI plays the default attention sound (bip-bop, ~3 beeps) repeatedly at
irregular intervals, completely unrelated to any event. The sound is not
triggered by question/permission/error/done events: at the moment it plays,
the log shows zero new entries, process CPU is flat, and there is no UI
activity. Sound stops as soon as opencode exits.

Plugins

None

OpenCode version

1.18.14

Steps to reproduce

  1. Windows 11 + WSL2 (Ubuntu), opencode 1.18.14 (latest)
  2. Enable attention sound in ~/.config/opencode/tui.json:
    { "attention": { "enabled": true, "sound": true, "notifications": false, "volume": 0.4 } }
  3. Use opencode normally until the agent completes a task and becomes idle
  4. Leave the session idle without touching the terminal
  5. After a short wait the default attention sound plays with no prompting,
    and repeats at irregular intervals (observed plays ~40s apart at
    22:49:10 / 22:49:50, then a longer gap)

Screenshot and/or share link

No response

Operating System

Windows 11 (opencode runs on WSL2 - Ubuntu)

Terminal

Windows Terminal (WSLg)

Activity

  1. anujbolewar commented on Aug 7, 2026

    @anujbolewar

    I started tracing this and need a small log to pin the exact trigger before I can land a precise fix.

    What I found so far: the notification for the completion sound fires in packages/tui/src/feature-plugins/system/notifications.ts on every session.status busy→idle transition per session (deduped only by a module-local active set, so one sound per busy→idle cycle). Server-side, busy is re-published at the top of every agent step (path src/session/processor.ts / the run loop) and idle is published once per completed run. So a repeated idle sound means a session is going busy→idle repeatedly while it looks idle to you — a few candidates: a subagent session completing in the background, a queued/steer prompt re-running, a status that gets stuck busy, or the active session-warming-opt-in plugin.

    To tell them apart, could you capture the actual event timeline? Drop this debug plugin at ~/.config/opencode/plugins/status-log.ts:

    import { appendFile, mkdir } from "node:fs/promises"
    import path from "node:path"
    
    export default {
      id: "debug-status-log",
      async tui(api: any) {
        const file = path.join(process.env.HOME ?? "", ".cache/opencode/status-events.log")
        await mkdir(path.dirname(file), { recursive: true })
        const line = (s: string) => appendFile(file, `${new Date().toISOString()} ${s}\n`).catch(() => {})
        await line("== started ==")
    
        api.event.on("session.status", (e: any) => {
          const parent = api.state.session.get(e.properties.sessionID)?.parentID
          line(`STATUS ${e.properties.sessionID} parent=${parent ?? "-"} ${JSON.stringify(e.properties.status)}`)
        })
        api.event.on("session.idle", (e: any) => {
          line(`IDLE ${e.properties.sessionID}`)
        })
      },
    }

    Then: 1) start opencode2, leave it idle, wait for the sound, 2) quit and paste ~/.cache/opencode/status-events.log.

    What the log tells us:

    • STATUS <id> ... busy then ... idle pairs around each sound + the parent value → whether it's the top-level session (done) or a subagent (subagent_done) cycling.
    • busy with no matching idle → a stuck-busy status.
    • an empty log while the sound plays → not session.status-driven, and I'll look at the audio path instead.

    If you could also run once with session-warming-opt-in disabled and share both logs, that bisects the most likely trigger.

  2. github-actions commented on Oct 8, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions