Skip to content

[Desktop] Repeated error alert sounds on startup caused by unhandled node-pty AttachConsole failure #32389

Description

@AlonDan

Description

OpenCode Desktop immediately triggers its internal "Play sound when an error occurs" notification sound multiple times right after startup, as soon as the UI appears.

The root cause is Error: AttachConsole failed thrown by the @lydell/node-pty-win32-x64 module (conpty_console_list_agent.js). This unhandled stderr warning is being interpreted by the Desktop app's notification system as an "error", which plays the built-in error sound.

This happens because OpenCode Desktop runs as an Electron GUI application (which has no attached Win32 console), but the ConPTY agent still attempts to call AttachConsole(shellPid) expecting a terminal environment. The crash is harmless functionally, but it falsely triggers the app's internal error alerts on every startup.

Plugins

No response

OpenCode version

OpenCode Desktop v1.17.7 (Bundled Node.js: v24.14.1 | node-pty: 1.2.0-beta.12)

Steps to reproduce

  1. Ensure "Errors -> Play sound when an error occurs" is enabled in OpenCode Desktop settings.
  2. Launch OpenCode Desktop and wait for the UI to appear (~5 seconds).
  3. Immediately hear repeated notification sounds from the app's internal error alert system (typically 2 beeps).
  4. Check main.log at %APPDATA%\@opencode-ai\desktop\logs\main.log.
  5. See entries like:
    [warn] sidecar stderr { message: '...\conpty_console_list_agent.js:13\r\nvar consoleProcessList = getConsoleProcessList(shellPid);\r\n ^\r\n\r\nError: AttachConsole failed...' }

Screenshot and/or share link

No response

Operating System

Windows 11 Pro

Terminal

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions