Skip to content

fix(installer): name System32's tar on Windows, not whatever PATH offers - #167

Open
jrlanglois wants to merge 1 commit into
solutionsunity:mainfrom
jrlanglois:jrlanglois/fix/windows-tar-install
Open

jrlanglois wants to merge 1 commit into
solutionsunity:mainfrom
jrlanglois:jrlanglois/fix/windows-tar-install

Conversation

@jrlanglois

@jrlanglois jrlanglois commented Nov 16, 2026 •

Copy link
Copy Markdown

Problem

An editor started from a Git Bash terminal hands its extension host that shell's PATH, where GNU tar sits ahead of System32.

extractArchive asked for the bare name tar, so PATH handed it GNU tar. GNU tar read the staging path C:\....\download.zip as a remote host:path: /usr/bin/tar: Cannot connect to C: resolve failed, exit 128.

Therefore, OpenCode V2 never launched; the agent card read "launch prerequisite unavailable".

GNU tar cannot open .zip at all anyway, and runtime-resolver.ts serves .zip on Windows: only bsdtar could do the job.

Repro

  1. Start the editor from a Git Bash terminal, so /usr/bin/tar precedes System32 on PATH.
  2. Let the installer fetch OpenCode V2 - a .zip.
  3. Install fails: Cannot connect to C: resolve failed, exit 128; the agent card reads "launch prerequisite unavailable".

Solution

tarCommand(platform, env) resolves the tool instead of letting PATH pick it: the bare name everywhere else, %SystemRoot% (SystemDrive, then C:)'s System32\tar.exe on Windows - bsdtar, which reads .zip and .tar.gz, takes Windows paths, and ships with Windows 10 1803+.

A tool that won't start now reports the path it tried. vitest pins the resolution and, on a Windows host, proves what it resolves really reports itself as bsdtar.

@jrlanglois
jrlanglois force-pushed the jrlanglois/fix/windows-tar-install branch 2 times, most recently from 8d091a3 to 1e39aab Compare November 16, 2026 19:27
An editor started from a Git Bash terminal hands its extension host that
shell's PATH, where GNU tar sits ahead of System32. extractArchive asked
for the bare name "tar", so GNU tar read the staging path
C:\...\download.zip as a remote host:path - /usr/bin/tar: Cannot connect
to C: resolve failed, exit 128 - and OpenCode V2 never launched: the agent
card read "launch prerequisite unavailable". GNU tar cannot open a .zip at
all either, and runtime-resolver.ts serves .zip on Windows, so bsdtar was
the only tool that could do the job whatever the colon did.

tarCommand(platform, env) resolves the tool instead of letting PATH pick
it: the bare name everywhere else, SystemRoot (SystemDrive, then C:) 's
System32\tar.exe on Windows - bsdtar, which reads .zip and .tar.gz and
takes Windows paths, and ships with Windows 10 1803+. A tool that won't
start now reports the path it tried. vitest pins the resolution and, on a
Windows host, proves what it resolves really reports itself as bsdtar.

Signed-off-by: Joël R. Langlois <joel.r.langlois@gmail.com>
@jrlanglois
jrlanglois force-pushed the jrlanglois/fix/windows-tar-install branch from 1e39aab to b974e31 Compare November 16, 2026 20:01

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant