Add Windows Warp Agent CLI autoupdates - #14446
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1d802f1 to
e3ca6b3
Compare
edd2d1a to
175db59
Compare
e3ca6b3 to
c0cec5e
Compare
f3a6466 to
7b77d2d
Compare
90f8877 to
753b488
Compare
3947550 to
dcd08f8
Compare
753b488 to
3982b28
Compare
dcd08f8 to
55dab3c
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR extends the Warp Agent CLI autoupdater to Windows by downloading ZIP artifacts, validating their contents and signatures, switching current/previous text pointers, sharing the installer lock, and adding Windows-focused tests.
Concerns
- The Authenticode validation accepts any trusted signer and disables revocation checks, so the updater does not prove the payload came from Warp/Microsoft as intended.
- The ZIP extractor rejects explicit
x64/orarm64/directory entries even though it requires files inside those directories, which can make otherwise valid Windows ZIP artifacts fail extraction depending on the packager.
Security
- The updater should validate expected signer identity for each executable payload and avoid accepting revoked signing certificates.
- Consider bounding ZIP extraction sizes so a malformed artifact cannot fill disk before signature validation completes.
Verdict
Found: 0 critical, 2 important, 1 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
| let mut trust_data = WINTRUST_DATA { | ||
| cbStruct: std::mem::size_of::<WINTRUST_DATA>() as u32, | ||
| dwUIChoice: WTD_UI_NONE, | ||
| fdwRevocationChecks: WTD_REVOKE_NONE, |
There was a problem hiding this comment.
WinVerifyTrust with WTD_REVOKE_NONE only proves the file chains to some trusted Authenticode signer and skips revocation, so a ZIP containing any validly signed executable under the expected names would be accepted. Validate the expected publisher/certificate for each payload (Warp for the CLI, Microsoft for ConPTY/OpenConsole) and enable revocation checks or otherwise fail closed.
|
|
||
| let is_required = required.iter().any(|required| required == &name); | ||
| let is_resource = name.starts_with("resources/"); | ||
| if !is_required && !is_resource { |
There was a problem hiding this comment.
x64/ or arm64/ directory entries before extraction even though x64/OpenConsole.exe or arm64/OpenConsole.exe is required, so ZIPs produced by tools that include directory entries can fail to autoupdate. Allow the selected assets directory when entry.is_dir().
| .create_new(true) | ||
| .open(&destination) | ||
| .with_context(|| format!("failed to create ZIP output {destination:?}"))?; | ||
| io::copy(&mut entry, &mut destination_file) |
There was a problem hiding this comment.
💡 [SUGGESTION] [SECURITY] io::copy extracts each ZIP member without a per-entry or aggregate uncompressed-size limit, so a malformed artifact can fill the staging volume before signature validation runs. Enforce expected maximum sizes or total extracted bytes while copying.
55dab3c to
d66a0e7
Compare
3982b28 to
9af5dfb
Compare
9af5dfb to
7fa5f45
Compare
d66a0e7 to
05be64f
Compare
## Description Make Windows Warp Agent CLI background updates download and execute the same signed Inno installer used for initial installation. Windows no longer parses or installs ZIP payloads in Rust. The updater verifies the installer with `WinVerifyTrust`, invokes it silently against the detected managed root, verifies the completed version and active pointer, and then performs conservative lease-aware cleanup. Unix tarball updates, polling, status, telemetry, custom-root detection, and live-version leases are unchanged. Artifact publication remains intentionally disabled. This replaces reference PR #14446 without modifying it. Depends on #14476 and warpdotdev/warp-server#13497. Implementation plan: https://staging.warp.dev/drive/notebook/BI2TyxneCNDssiTUVIF0iK ## Linked Issue - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [ ] Where appropriate, screenshots or a short video of the implementation are included below. ## Testing - `./script/format` - Repository-prescribed split Clippy checks - `cargo test -p warp_tui --lib autoupdate --features release_bundle,standalone,crash_reporting` — 17 passed - Windows tests retain Authenticode rejection, installed-payload validation, custom-root arguments, current/previous behavior, rollback retention, and live-version garbage collection - Native Windows and cross-repository release validation will be linked after the remote branches are exercised - [ ] I have manually tested my changes locally with `./script/run` ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-NONE Co-Authored-By: Warp <agent@warp.dev> Co-authored-by: Warp <agent@warp.dev>

Description
Adds phase 4 of the Windows Warp Agent CLI release stack on top of #14445:
conpty.dll, andOpenConsole.execurrentandprevioustext pointersversions/<version>layoutThis expects companion installer PR warpdotdev/warp-server#13454 to use the same
versions/,current,previous, and.update.lockcontract. Windows artifact publication remains intentionally disabled in this stack.Conversation: https://staging.warp.dev/conversation/7b2fa858-09f9-47dd-8819-277acd3fa779
Linked Issue
No linked issue.
ready-to-specorready-to-implement.Testing
CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo test -p warp_tui 'autoupdate::tests' --lib(18 passed)CARGO_INCREMENTAL=0 CARGO_PROFILE_DEV_DEBUG=0 cargo check -p warp_tui --testscargo clippy -p warp_tui --all-targets --all-features -- -D warnings./script/formatrepository-required workspace, GUI-default, and completer Clippy invocations with
-D warningscomplete final-sha native CI passed Windows signature, pointer, installer-lock, lease-race, rollback-GC, Clippy, release compilation, and full test validation: https://github.com/warpdotdev/warp-internal/actions/runs/30419318109
companion native installer workflow passed: https://github.com/warpdotdev/warp-server/actions/runs/30414888912
I have manually tested my changes locally with
./script/runAgent Mode
CHANGELOG-NONE