Repository navigation
Description
Description
EUNKNOWN: unknown error, uv_spawn when loading any skill (including with --pure) on a Windows machine where PowerShell execution is denied by Group Policy / AppLocker. cmd.exe and direct file reads work fine — only skill loading fails.
Root cause (found in source)
packages/opencode/src/tool/skill.ts— theskilltool callsripgrep.find({ cwd: dir, ... })to list the skill's files every time a skill is loaded.packages/core/src/ripgrep/binary.ts—RipgrepBinary.Service.filepathresolves thergbinary by: (1) checkingwhich("rg.exe")on PATH, (2) checking a cached copy, (3) downloadingripgrep-<version>-<arch>-pc-windows-msvc.zipfrom GitHub and extracting it.- On Windows, the
.zipextraction path is hardcoded to PowerShell, with no fallback:
if (config.extension === "zip") {
const shell = (yield* Effect.sync(() => which("powershell.exe") ?? which("pwsh.exe"))) ?? "powershell.exe"
const result = yield* run(shell, [
"-NoProfile", "-NonInteractive", "-Command",
`$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -LiteralPath '${archive}' -DestinationPath '${dir}' -Force`,
])
...
}On a machine where PowerShell execution is denied by policy, which("powershell.exe") still resolves the binary (it's present on disk and on PATH — the policy denies execution, not presence), so the code proceeds to spawn it. Windows then rejects the CreateProcess call at the OS level (observed message: "This program is blocked by group policy"). That rejection surfaces as an unclassified/unknown error to libuv — hence EUNKNOWN: unknown error, uv_spawn instead of a more legible permission error.
Windows ships tar.exe natively (used for .tar.gz on other platforms in the same file), which can extract .zip archives too and is not subject to the PowerShell policy restriction. Using tar (or falling back to it when PowerShell isn't available/executable) instead of Expand-Archive for the Windows .zip case would avoid this failure mode entirely.
Reproduced
On a Windows 11 VM with an AppLocker policy that denies powershell.exe/pwsh.exe/powershell_ise.exe execution for a specific user (everything else allowed):
> where powershell.exe
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
> powershell.exe -NoProfile -NonInteractive -Command "Write-Host hello"
This program is blocked by a group policy. For more information, contact your system administrator.
opencode's .cache\opencode\bin\ directory on that account contained a downloaded-but-never-extracted ripgrep-15.1.0-aarch64-pc-windows-msvc.zip, re-downloaded on every session (extraction silently failing each time, never producing rg.exe).
Manually extracting the same zip with tar -xf ripgrep-....zip -C <dir> works without issue on the same account, confirming tar is not affected by the policy that blocks PowerShell.
Workaround
Place a working rg.exe somewhere already on PATH — RipgrepBinary.filepath checks which("rg.exe") first and skips the download/extract path entirely if found.
OpenCode version
Observed on 1.18.25 and reported independently on 1.18.33; the relevant code (packages/core/src/ripgrep/binary.ts) is unchanged between those versions (last touched 2026-06-30).
Operating System
Windows 11 (reproduced on ARM64; the extraction mechanism itself is architecture-independent — any Windows machine with PowerShell execution denied by policy should hit this)
Terminal
cmd.exe / non-interactive (scheduled task)
Activity
github-actions commentedon Sep 30, 2026
This issue might be a duplicate of existing issues. Please check:
ggbdpq commentedon Oct 1, 2026
Confirmed in source: on policy-restricted machines
which("powershell.exe")still resolves the binary (policy denies execution, not presence), theExpand-Archivespawn gets rejected at CreateProcess, and it surfaces as the opaqueEUNKNOWN uv_spawn.Windows ships a libarchive-based
tar.exein System32 (Win10 1803+) that extracts zip archives and is not subject to PowerShell execution policy, so I'll switch the zip branch to prefer it and keepExpand-Archiveas the fallback for systems without tar.exe. Taking this one.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊