Skip to content

fix(util): hide plugin Git console windows on Windows - #55475

Merged
neriousy merged 5 commits into
devfrom
hide-plugin-windows
Oct 15, 2026
Merged

neriousy merged 5 commits into
devfrom
hide-plugin-windows

Conversation

@neriousy

@neriousy neriousy commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #50868.
Closes #55457.

Related: #52299 (Git spawns during plugin install/reload), #52281, #52266, #53730, and #51887. This PR fixes OpenCode's npm-managed Git spawns; it does not change third-party plugin subprocess calls, snapshot/MCP spawning, tasklist.exe, or plugin-install retry behavior.

Pass windowsHide: true to Pacote's package checks and Arborist's install/update options. Their Git subprocesses bypass AppProcess, so a console-less background service otherwise opens a visible Windows Terminal/console window for git ls-remote and related Git operations. Pacote and @npmcli/git forward this option to the underlying spawn.

Verification

  • Reproduced on Windows 11 (build 26300), Bun 1.4.2, Git 2.48.1.windows.1. An isolated copy of the original Npm.check code opened a visible Windows Terminal window titled C:\Program Files\Git\cmd\git.exe for the issue's unpinned superpowers spec. A deliberately slow local HTTP Git remote kept its console visible for approximately 2.2 seconds. A full-commit-pinned control opened no window. No installed plugin configuration was changed or third-party plugin code executed; installed-revision metadata was seeded in a temporary cache.
  • Re-ran the same reproduction against the fixed worktree: the parent had no console, the GitHub check completed, the slow remote followed the expected error path, and EnumWindows + IsWindowVisible monitoring detected zero console/Windows Terminal windows.
  • During local verification, a temporary Windows console probe exercised installs, checks, and updates. It failed when either windowsHide option was independently removed and passed with both present. The probe is not included in this PR.
  • bun test test/npm.test.ts from packages/core.
  • bun run check from the repository root.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks right. I couldn't run it, because the bug only shows up on Windows and this sandbox is Linux. Instead I traced the code in the installed dependencies: pacote and @npmcli/git pass the whole options object to the Git spawn, so windowsHide: true reaches git ls-remote/clone in both the update check and Arborist install/update. bun test test/npm.test.ts and the util/core type checks pass.

Public API: unchanged.

The one concern is the new test (inline comment): it's heavy and brittle for a two-option fix and can be dropped.

Fixes #55457

Comment thread packages/core/test/npm.test.ts Resolved
@neriousy
neriousy enabled auto-merge (squash) October 14, 2026 16:57
@neriousy
neriousy disabled auto-merge October 14, 2026 18:21
@neriousy
neriousy merged commit d0f3204 into dev Oct 15, 2026
19 checks passed
@neriousy
neriousy deleted the hide-plugin-windows branch October 15, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant