Skip to content

Add Windows Warp Agent CLI autoupdates - #14446

Open
kevinyang372 wants to merge 1 commit into
07-28-build_windows_warp_agent_cli_in_dev_releasesfrom
07-28-add_windows_warp_agent_cli_autoupdates
Open

Add Windows Warp Agent CLI autoupdates#14446
kevinyang372 wants to merge 1 commit into
07-28-build_windows_warp_agent_cli_in_dev_releasesfrom
07-28-add_windows_warp_agent_cli_autoupdates

Conversation

@kevinyang372

@kevinyang372 kevinyang372 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Description

Adds phase 4 of the Windows Warp Agent CLI release stack on top of #14445:

  • downloads and strictly validates Windows ZIP artifacts before staging them
  • verifies Authenticode signatures for the CLI, conpty.dll, and OpenConsole.exe
  • atomically activates immutable versions through current and previous text pointers
  • shares the installer's persistent update lock and preserves live versions with process leases
  • retains the rollback version during garbage collection and cleans inactive lease-aware versions
  • supports managed installs under custom roots by detecting the running versions/<version> layout

This expects companion installer PR warpdotdev/warp-server#13454 to use the same versions/, current, previous, and .update.lock contract. 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.

  • 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 (especially for user-visible or UI changes).

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 --tests

  • cargo clippy -p warp_tui --all-targets --all-features -- -D warnings

  • ./script/format

  • repository-required workspace, GUI-default, and completer Clippy invocations with -D warnings

  • complete 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/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

@cla-bot cla-bot Bot added the cla-signed label Jul 28, 2026

Copy link
Copy Markdown
Member Author

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch from 1d802f1 to e3ca6b3 Compare July 28, 2026 22:35
@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch from edd2d1a to 175db59 Compare July 28, 2026 22:35
@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch from e3ca6b3 to c0cec5e Compare July 29, 2026 01:03
@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch 2 times, most recently from f3a6466 to 7b77d2d Compare July 29, 2026 01:12
@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch 2 times, most recently from 90f8877 to 753b488 Compare July 29, 2026 01:28
@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch 2 times, most recently from 3947550 to dcd08f8 Compare July 29, 2026 02:05
@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch from 753b488 to 3982b28 Compare July 29, 2026 03:19
@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch from dcd08f8 to 55dab3c Compare July 29, 2026 03:19
@kevinyang372
kevinyang372 marked this pull request as ready for review July 29, 2026 05:07
@oz-for-oss

oz-for-oss Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@kevinyang372

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/ or arm64/ 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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] [SECURITY] 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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [IMPORTANT] This rejects explicit 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 [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.

@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch from 55dab3c to d66a0e7 Compare July 30, 2026 01:40
@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch from 3982b28 to 9af5dfb Compare July 30, 2026 01:41
@kevinyang372
kevinyang372 force-pushed the 07-28-build_windows_warp_agent_cli_in_dev_releases branch from 9af5dfb to 7fa5f45 Compare July 30, 2026 01:53
@kevinyang372
kevinyang372 force-pushed the 07-28-add_windows_warp_agent_cli_autoupdates branch from d66a0e7 to 05be64f Compare July 30, 2026 01:53
kevinyang372 added a commit that referenced this pull request Jul 31, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant