Skip to content

windows: shell tool spawns visible powershell/conhost windows on every call #55085

Closed as not planned

Description

@porzioev

Summary

On Windows, every shell tool call spawns a visible powershell.EXE + conhost.exe window that opens and closes rapidly. Parallel tool calls produce a cascade of flashing cmd windows.

Environment

  • opencode version: 2.0.26 (skill snapshot at registration; opencode --version Unavailable: opencode.ps1 blocked by ExecutionPolicy PSSecurityException/UnauthorizedAccess)
  • OS: Windows_NT 10.0.26100 (win32 x64) (skill snapshot; ver Unavailable: cmd builtin, not valid in PowerShell)
  • Terminal: Unavailable: no TERM/TERM_PROGRAM/COLORTERM vars (OpenCode Desktop app)
  • Shell: C:\WINDOWS\system32\cmd.exe ($ComSpec, skill snapshot)
  • Install/channel: latest; server = ...\ai.opencode.desktop\cli\2.0.26\opencode-cli.exe serve --service (child of OpenCode.exe, seen in Win32_Process)
  • Active plugins: opencode-supermemory@latest; local plugin/slow-connect-fix.js fails to load (PluginModule.LoadError, see server log WARN)

Reproduction

  1. Windows 10/11 + OpenCode Desktop (service mode: opencode-cli.exe serve --service).
  2. Send any prompt that makes the agent use shell tools, especially several in parallel (e.g. filesystem scans).
  3. Watch the screen: one cmd/powershell window flashes open+closed per shell call.

Minimal probe (also the monitor's observer effect): a single shell call = 1 flash.

Expected Behavior

Tool subprocesses spawn hidden (CREATE_NO_WINDOW / windowsHide, i.e. the equivalent of -WindowStyle Hidden — like the already-hidden ollama-idle-daemon.ps1 process on the same machine, which never flashes).

Actual Behavior

Each shell call = 1× C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE -NoLogo -NoProfile -NonInteractive -Command "..." (direct child of opencode-cli.exe, PID 10900 observed) + 1× conhost.exe child of it. Server log confirms: message="spawning process" command="C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.EXE" args="[-NoLogo,-NoProfile,-NonInteractive,-Command,...]" per call, with no hidden-window flag.

Measured with a 250 ms Win32_Process polling daemon (children of opencode-cli.exe + their conhost): 171 flashes intercepted in ~43 min (79× powershell.exe + 90× conhost.exe), log in cmd-watch/events.csv, server PID 10900 constant.

Additional Context

  • Config docs (https://opencode.ai/v2/docs/config) expose only "shell": "<path>" (path string, no hide-window option) — setting an explicit shell path does not provide a hide flag. [Verified 2026-10-11]
  • Frequency: consistent, 100% reproducible on every shell call.
  • Recent change (probable trigger, not root cause): sessions started issuing many parallel shell calls (10+ parallel disk scans in server log 2026-10-11 07:57–07:59 UTC); older sessions used mostly read/grep/glob (no subprocess, no flash).
  • Workaround in use: batch all commands into a single shell call per turn with ;, prefer read/glob/grep/edit tools (no spawn). Reduces cascade from N flashes to 1, does not eliminate it.

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed measurements!

    Before we go further, there's one thing we need to check. On Windows, the core shell tool already starts its PowerShell process with windowsHide (CREATE_NO_WINDOW), so that PowerShell shouldn't get a visible window. A hidden PowerShell still creates a conhost.exe, though. That means polling Win32_Process shows a powershell + conhost pair for every call, whether or not a window actually appears on screen. So the 171 events confirm the processes were started, but not that those processes opened visible windows.

    In similar reports, the visible window came from a plugin. One was opencode-supermemory, which you have installed: in #52281 it was found to run git through execSync without windowsHide. Another was a plugin hook that runs before every tool call, which makes it look like every tool call flashes.

    Could you please:

    1. Temporarily remove opencode-supermemory and the local plugin/slow-connect-fix.js (from the plugins array in your config and from the plugin(s)/ folders), restart the Desktop app, and run a few shell calls. Do the flashes still happen?
    2. If they do, tell us what the flashing window actually is: its title (e.g. powershell.exe, git.exe, cmd.exe) or a screenshot or screen recording. A tool that lists visible windows (ConsoleWindowClass / CASCADIA_HOSTING_WINDOW_CLASS) instead of processes would also work. Tell us too whether your default terminal application is Windows Console Host or Windows Terminal.

    You can reply here with the details, or edit the issue. If you edit it, please also leave a comment saying you've updated it, so we know you're done.

    These issues might already cover your problem (ordered from most to least likely):

  2. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    We haven't heard back, so I'm closing this for now.

    We were waiting to find out two things: whether the flashes still happen with opencode-supermemory and the local slow-connect-fix.js plugin removed, and what the visible window actually is (its title, a screenshot, or a log of visible windows rather than processes). The core shell tool already starts PowerShell with windowsHide. A hidden PowerShell still creates a conhost.exe, so the process counts alone can't show where the visible windows come from.

    If you can check this, please reply with what you find and we can reopen the issue. Until then, these issues cover the most likely causes:

    Thanks again for the detailed report.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions