Skip to content

fix(desktop): use .NET ZipFile via Add-Type for sidecar extraction on Windows - #7436

Open
NeoDesign wants to merge 1 commit into
different-ai:devfrom
NeoDesign:feature/windows-node26-support
Open

NeoDesign wants to merge 1 commit into
different-ai:devfrom
NeoDesign:feature/windows-node26-support

Conversation

@NeoDesign

@NeoDesign NeoDesign commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Fixes pnpm --filter @openwork/desktop prepare:sidecar failing on Windows when invoked in a PowerShell 7 environment.

Details

  • Child Windows PowerShell 5.1 processes inherit PSModulePath from PowerShell 7 and load PowerShell 7's Microsoft.PowerShell.Archive module, causing Expand-Archive to fail on ExtractToDirectory.
  • Updated apps/desktop/scripts/prepare-sidecar.mjs on win32 to load System.IO.Compression.FileSystem via Add-Type and extract the archive with [System.IO.Compression.ZipFile]::ExtractToDirectory.

Verification

  • Ran pnpm --filter @openwork/desktop prepare:sidecar on Windows with exit code 0.

@vercel

vercel Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

@NeoDesign is attempting to deploy a commit to the Different AI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-landing Ready Ready Preview, v0 Nov 21, 2026 6:44am UTC

Request Review

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Contributor screen: passed

Commit e7281bf9c6 · run

No hidden characters, dependency, database or obfuscation concerns.

Nothing else runs yet. A maintainer reviews the changes then comments /test to start the tests.

@benjaminshafii benjaminshafii left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this, and for digging into the Windows build. We ran the branch (head 7710179) against its merge-base in fresh Windows and Linux sandboxes. Summary: the sidecar fix is real and we'd like to merge it, but the other changes need to come out first.

Sidecar extraction (prepare-sidecar.mjs): confirmed, please keep

  • On the base commit, pnpm --filter @openwork/desktop prepare:sidecar started from PowerShell 7 exits 1 with Expand-Archive : Cannot find an overload for "ExtractToDirectory" and the argument count: "3". From Windows PowerShell 5.1 and cmd it works.
  • On your branch it exits 0 from PowerShell 7, 5.1 and cmd (fresh, already present, forced re-download), and opencode.exe --version runs.
  • The cause is not a type cast error: the 5.1 child inherits PSModulePath from PowerShell 7 and loads PowerShell 7's Microsoft.PowerShell.Archive module. Could you update the description and the code comment to say that?
  • LoadWithPartialName is deprecated; please use Add-Type -AssemblyName System.IO.Compression.FileSystem instead.

Node 26 (.nvmrc, .npmrc, root engines): please drop

  • Install, pnpm build and the server tests already pass on Node 26.13.1 on the base commit, so these changes aren't what makes it work. Removing .npmrc gave the same result.
  • The .nvmrc bump fails our baseline-consistency test ('26.13.1' vs '24.22.1'), and CI and the other workspace packages still pin Node 24.
  • Moving the repo to Node 26 is something we'd do in one change across CI, all packages and the server launcher, which currently refuses anything but Node 24.

Browser tool (openwork-chrome-devtools.ts): please drop

  • With this change, inputs that fail the schema are forwarded instead of rejected. In our test a non-URL, 50 actions (limit is 8), an unknown action type with extra fields and a 100,000-character question were all rejected before and forwarded after.
  • A later layer still rejects them, but we don't want to remove this check. If you hit a real crash here, please open an issue with the input and the error and we'll fix the cause.

WINDOWS.md and .gitignore are best sent separately too, so this PR is just the one fix. Once it's trimmed to prepare-sidecar.mjs we'll run the tests and merge.

@reachjalil

Copy link
Copy Markdown
Member

Thanks for working on Windows support. A few things block this one: the browser_act change falls back to unvalidated arguments when validation fails (#6988 fixes the same issue while keeping validation), and the PR also bumps .nvmrc, widens the Node engine range, adds engine-strict=false, adds personal .gitignore entries and strips comments. If the sidecar unzip change is what Windows actually needs, a small PR with only that change would be easy to review.

brianpadilla3072 added a commit to brianpadilla3072/comex-desktop that referenced this pull request Nov 20, 2026
From PowerShell 7 the powershell 5.1 child inherits PSModulePath and
loads PowerShell 7's Microsoft.PowerShell.Archive module, so
Expand-Archive fails with "Cannot find an overload for
ExtractToDirectory". Unzip with .NET ZipFile (Add-Type -AssemblyName
System.IO.Compression.FileSystem), clearing a leftover extract folder
first. Works from PowerShell 7, Windows PowerShell 5.1 and cmd.

Port of different-ai#7436, sidecar fix only, as the maintainers
asked (no Node 26 bump, .npmrc, WINDOWS.md or browser tool change).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NeoDesign

Copy link
Copy Markdown
Author

@reachjalil @benjaminshafii Thanks for the clear feedback and review! I've narrowed the PR down to apps/desktop/scripts/prepare-sidecar.mjs, switched to Add-Type -AssemblyName System.IO.Compression.FileSystem, and updated the PR description to reflect the PSModulePath inheritance root cause.

@NeoDesign NeoDesign changed the title Feature/windows node26 support fix(desktop): use .NET ZipFile via Add-Type for sidecar extraction on Windows Nov 21, 2026
@NeoDesign
NeoDesign marked this pull request as ready for review November 21, 2026 07:08

This branch was successfully deployed

1 active deployment
Preview – openwork-landing — e7281bf9 Deployed Nov 21, 2026 by vercel[bot]
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.

3 participants