Repository navigation
fix(cli): install the pinned iii engine on Windows - #1670
Conversation
A fresh agentmemory on win32 exited with "Auto-install unavailable on win32" because the installer only handled tar.gz assets through sh, curl and tar. Windows assets are zip files. The zip path now downloads the pinned asset with fetch, checks it against the same pinned SHA-256 table as every other platform, and extracts iii.exe into the private bin directory with System32 tar.exe, falling back to PowerShell Expand-Archive. Both run without a shell. A missing checksum still downloads nothing, and a mismatch deletes the archive before any extraction.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Merge Risk:
|
- Each install downloads to its own archive name (pid plus random suffix), so two starts into the same bin directory cannot delete or overwrite each other's download before verification. - Archive cleanup never throws, so a failed delete after a successful extraction no longer turns the install into a failure. - When HTTPS_PROXY, HTTP_PROXY or ALL_PROXY is set, the zip is fetched with System32 curl.exe, which honors those variables on every supported Node version. Without a proxy the built-in fetch is used. Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
- Extraction now writes into a per-install staging directory and moves iii.exe over the existing binary only after the staged copy exists, so a failed or partial extraction never destroys a working iii.exe. - Install commands (proxied curl download, tar.exe, Expand-Archive) run through an async spawn with a kill timeout instead of spawnSync, so the startup Ctrl+C handlers keep running during a stalled download. - Archives and staging folders left by earlier failed installs are removed once they are older than 15 minutes. Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
After a failed install the warning said to extract iii.exe into %USERPROFILE%\.agentmemory\bin, while the Setup required box below it still said %USERPROFILE%\.local\bin. Both folders are searched; the setup steps now name the one the installer itself uses. Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
- A running curl, tar or PowerShell child is killed when the CLI exits, so cancelling a start with Ctrl+C no longer leaves it downloading or extracting in the background. - A filesystem error while creating the staging folder or running an extractor now returns an extract failure, so the spinner stops and the manual install steps are printed. Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
The error handler resolved as soon as any child error fired. When a kill failed on a child that was still running, the installer moved on and removed the staging folder while the extractor kept writing, and the exit-time kill was dropped. The runner now resolves from error only when the child never spawned; otherwise it waits for close. Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
Bug
On native Windows, a fresh
agentmemoryexits 1 after about a second:Found by a clean Windows Server 2022 run of main. Every new Windows user hits it on the first start.
Cause
runIiiInstalleronly knew the tar.gz path (sh + curl + tar). For zip assets it printed manual steps and returned.Fix
installIiiZipinsrc/cli/engine-install.ts:fetch(300 s cap)III_RELEASE_SHA256table the other platforms use; no pinned checksum means no download, a mismatch deletes the archive before extraction%SystemRoot%\System32\tar.exe -xfand falls back topowershell.exe -NoProfile -NonInteractive Expand-Archive; both run throughspawnSyncwithshell: falseandwindowsHide: true; PowerShell paths are single-quote literals with'doublediii.exeexists in the private bin directory afterwardsrunIiiInstalleruses it for zip assets; on failure it prints the download URL, the expected SHA-256 and the target directory.The consent rules do not change: Windows already chose the install path without a prompt (#1658).
Testing
test/engine-install.test.ts(8 new): extractor order and arguments, PowerShell quoting, install on matching checksum, tar to Expand-Archive fallback, no extraction on checksum mismatch, no download without a pinned checksum, extract failure when no iii.exe appears, pinned checksums present for both Windows assets.npm run build,npm run skills:check,cli-engine-startup,engine-installandcli-lifecycle-safetytests pass.Summary by CodeRabbit
Windows verification
Clean Windows Server 2022 with no iii anywhere, #1670 + #1671 + #1672 + #1362 merged: first
agentmemorywith CI=1 downloaded the pinned v0.25.0 zip, iii.exe landed in %USERPROFILE%\.agentmemory\bin (reports 0.25.0), livez 200 after 9.4 s; remember 201 and smart-search returned the memory. Devin session: https://app.devin.ai/sessions/19b3aff181f8433a8c776ced7a077a59Re-verified at 4575a17 on a clean Windows Server 2022 (https://app.devin.ai/sessions/92c438809e614eb187e609812fe7f4ab): pinned iii installed through the staging folder with no leftovers, livez 200 at 7.6 s; a 2-hour-old stale archive was removed on the next install; an unreachable HTTPS_PROXY failed in 3.2 s with the manual steps and no leftover files.