GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — shell: Store PowerShell fails with 0xC0070005 in Windows pipe mode · Issue #63892 · anomalyco/opencode

shell: Store PowerShell fails with 0xC0070005 in Windows pipe mode #63892

New issue
Copy link
New issue
Copy link
Closed
#64901
Closed
shell: Store PowerShell fails with 0xC0070005 in Windows pipe mode#63892
#64901
Copy link
Labels
area/serviceBackground service and serverplatform/windowsWindowstype/bugSomething is brokenversion/v2OpenCode 2.x

Description

@Simon7612
Simon7612
opened on Nov 14, 2026
Issue body actions

Description

Description

After updating OpenCode from 2.2.7 to 2.3.0 on Windows, shell tool calls using Microsoft Store PowerShell 7 fail before executing even a one-line command:

failed to spawn C:\Program Files\WindowsApps\Microsoft.PowerShell_7.7.0.0_x64__8wekyb3d8bbwe\pwsh.EXE:
OS Error -1073283067 (FormatMessageW() returned error 317) (os error -1073283067)

-1073283067 is 0xC0070005. Expected: the command executes and returns its output. Actual: process creation fails, in both a project directory and a separate temporary directory.

Isolated Win32 reproduction

A standalone C# P/Invoke probe, independent of OpenCode/plugins, called CreateProcessW for the same packaged executable with -NoLogo -NoProfile -NonInteractive -Command "exit 0" and CREATE_NO_WINDOW. Changing only the job attachment strategy produced:

Creation strategy Store PowerShell 7.7 Windows PowerShell 5.1
No explicit job attribute Success, exit 0 Success, exit 0
STARTUPINFOEXW + EXTENDED_STARTUPINFO_PRESENT + PROC_THREAD_ATTRIBUTE_JOB_LIST containing one newly created unnamed job Fails: 0xC0070005 Success, exit 0
Normal creation, then AssignProcessToJobObject Success, assignment succeeds, exit 0 Success, exit 0

Three additional consecutive rounds reproduced the same Store executable results. Normal ProcessStartInfo creation also succeeds for both the real packaged EXE and its app-execution aliases. Get-AppxPackage Microsoft.PowerShell reports Status=Ok and IsPartiallyStaged=False.

At the failing timestamps, Microsoft-Windows-AppModel-Runtime/Admin records:

  • Event 212, 0x80070005: cannot add the process to the package's Desktop AppX container.
  • Event 208, 0x80070005: cannot create the package process while configuring its runtime, [FinishPackageActivation].

Relevant implementation

The running shell process is launched through opencode-pty 0.5.2, in pipe mode. The current Windows pipe implementation supplies PROC_THREAD_ATTRIBUTE_JOB_LIST during CreateProcessW.

Its jobless retry only accepts raw ERROR_ACCESS_DENIED (5); the packaged EXE returns 0xC0070005, so that retry is skipped. The standalone probe returns 5 when given the app-execution alias instead of the real packaged path. This error-code distinction appears relevant to the missed fallback.

The 2.2.7 shell service directly spawned commands; 2.3.0 delegates local commands to the process daemon. Related introduction: #63196; follow-up: #63346. The previous 2.2.7 binary was not rerun during this diagnosis, so the version boundary is based on observed upgrade history and source comparison, not a binary bisect.

This differs from closed #62512: that issue returned exit 0 with empty output through the Store alias; this one fails to create the real packaged process.

Workaround verified: explicitly selecting Windows PowerShell 5.1 restores shell execution. MSI/ZIP PowerShell 7 was not installed or tested. No WindowsApps ACL changes or package repairs were made.

Plugins

@tarquinen/opencode-dcp@latest, oh-my-opencode-slim. OpenCode itself was not retested with plugins disabled; the standalone Win32 probe has no plugin dependency.

OpenCode version

opencode v2.3.0, latest/release channel, installed through Scoop; managed serve --service process. Process daemon: opencode-pty 0.5.2.

Steps to reproduce

  1. On Windows, use Microsoft Store PowerShell 7 (observed package: Microsoft.PowerShell_7.7.0.0_x64__8wekyb3d8bbwe), with OpenCode 2.3.0 selecting that shell.
  2. Ask the shell tool to run Write-Output 'probe'.
  3. Observe the spawn failure above, before any command output. Changing the working directory does not help.
  4. For an API-level comparison, create that same EXE with and without PROC_THREAD_ATTRIBUTE_JOB_LIST, as described in the table.

Operating System

Windows x64, Windows_NT 10.0.26300 ([Environment]::OSVersion: 10.0.26300.0). Store PowerShell reports 7.7.0. System Windows PowerShell reports 5.1.26100.9818.

Terminal

Exact frontend terminal application unavailable. Shell-tool environment has TERM=xterm-256color (injected by OpenCode); TERM_PROGRAM, COLORTERM, and WT_SESSION are unset. ComSpec=C:\WINDOWS\system32\cmd.exe.

Plugins

No response

OpenCode version

2.3.0

Steps to reproduce

No response

Screenshot

No response

Operating System

No response

Terminal

No response

Reacted by NiNeDelixe, Shouyuan and themerror

Activity

  1. opencodejr
    added
    area/serviceBackground service and server
    platform/windowsWindows
    type/bugSomething is broken
    version/v2OpenCode 2.x
    on Nov 14, 2026
  2. opencodejr commented on Nov 14, 2026

    @opencodejr
    opencodejrBot
    on Nov 14, 2026
    Contributor
    More actions

    Thanks for the detailed report and the standalone Win32 probe.

    I couldn't reproduce this here. It needs Windows with PowerShell 7 installed from the Microsoft Store, and this sandbox runs Linux, so a maintainer with that setup will need to confirm it.

    On the latest dev (6205e99), spawn() in packages/process-daemon/src/service/pipe/windows.rs still retries without the job only when the error is exactly ERROR_ACCESS_DENIED (5). If Windows returns 0xC0070005 for the packaged pwsh.EXE, as your probe shows, that retry is skipped, which matches the failure you describe. I haven't been able to observe that Windows behaviour myself.

    Until then, the workaround you found (selecting Windows PowerShell 5.1) should keep the shell tool working.

  3. devicbest commented on Nov 15, 2026

    @devicbest
    devicbest
    on Nov 15, 2026
    More actions

    Confirming from a working setup, to narrow this down:

    • Windows 11 x64, OpenCode Desktop 2.3.0 (opencode-cli 2.3.0-x64)
    • Shell in use: Windows PowerShell 5.1 at C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    • Shell tool calls work normally (no 0xC0070005)

    So the failure looks tied to the Microsoft Store pwsh 7 binary path (C:\Program Files\WindowsApps\...), not to 2.3.0 or Windows itself: same OS and same OpenCode version, only the shell executable differs.

  4. mvanhorn commented on Nov 15, 2026

    @mvanhorn
    mvanhorn
    on Nov 15, 2026
    More actions

    Implemented in #64137.

  5. themerror commented on Nov 18, 2026

    @themerror
    themerror
    on Nov 18, 2026
    More actions

    It is a Windows bug, perhaps.
    I used OpenCode to debug Windows, it found:

    On Windows 11 Insider build 10.0.26340.9882, launching MSIX PowerShell 7.7.0 through its app execution alias intermittently fails with ERROR_ACCESS_DENIED.

    The caller creates the process with ConPTY and PROC_THREAD_ATTRIBUTE_JOB_LIST, targeting a newly created Job. AppInfo then performs the Desktop AppX post-create step:

    daxexec!PostCreateProcessDesktopAppXActivation
      → helium::AddProcessToContainer
      → AssignProcessToJobObject(Helium container Job, new process)
      → FALSE, GetLastError = 5
    

    This produces AppModel events 212 followed by 208 with ErrorCode=0x80070005, and CreateProcessW returns error 5. The created process is discarded. Retrying without JOB_LIST succeeds with a new PID, usually 60–110 ms later.

    The failure occurs when the Helium container Job already contains a live process. The new Job supplied through JOB_LIST has no existing parent/child relationship with that non-empty Helium Job, so the nested assignment is rejected. When the container Job is empty, the same JOB_LIST launch succeeds. The Helium Job has no UI restrictions and is not terminating.

  6. neriousy
    closed this as completedin #64901on Nov 19, 2026
  7. Simon7612 commented on Nov 20, 2026

    @Simon7612
    Simon7612
    on Nov 20, 2026
    Author
    More actions

    Thank you for your positive feedback and for your assistance in analyzing and resolving the issues. I truly appreciate your help.

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

    area/serviceBackground service and serverplatform/windowsWindowstype/bugSomething is brokenversion/v2OpenCode 2.x

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.