Skip to content

APP-3805: Auto-update SSH remote-server binary on version skew#9328

Merged
alokedesai merged 6 commits into
masterfrom
aloke/autoupdate_remote_server
Apr 30, 2026
Merged

APP-3805: Auto-update SSH remote-server binary on version skew#9328
alokedesai merged 6 commits into
masterfrom
aloke/autoupdate_remote_server

Conversation

@alokedesai
Copy link
Copy Markdown
Member

Description

APP-3805 — handle client/server version skew for the SSH remote-server binary.

Previously the remote binary lived at a single unversioned path. When a client updated but the remote still had an older binary, the two could silently go out of sync.

This PR does three things:

  1. Version the installed path. The binary is now written to {dir}/{binary_name}-{version}, so any client-server drift becomes a path miss and triggers a reinstall. The unversioned path is kept for cargo run / deploy_remote_server dev loops.
  2. Check versions on handshake. initialize() now compares server_version against the client's release tag. On mismatch, the manager deletes the stale binary, tears the session down, and emits SessionConnectionFailed so the failed-banner path fires.
  3. Auto-update without a prompt. When check_binary() misses but the remote already has an install directory, we skip the "Install Warp SSH tools?" modal and install directly with is_update: true. The shimmer reads "Updating Warp SSH Extension..." instead of "Installing...". Dev clients without a release tag fall through to the normal prompt so they don't accidentally CDN-install over a locally-deployed binary.

Testing

  • cargo test -p remote_server, cargo clippy -D warnings, cargo fmt — all clean.
  • Manual against alokedesai@136.107.29.130:
    • Fresh install: modal → "Installing Warp SSH Extension..." → Ready.
    • Reconnect with a newer client tag: handshake mismatch detected, stale binary removed, reconnect reinstalls.
    • Reconnect with an older client tag while a newer versioned binary is on the remote: auto-update, no modal, "Updating..." shimmer.
    • Forced install failure on the update path: failed banner renders.

Server API dependencies

None — warp-server already supports ?version= on /download/cli (#10284).

@cla-bot cla-bot Bot added the cla-signed label Apr 28, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 28, 2026

@alokedesai

I'm starting a first review of this pull request.

You can follow along in the session on Warp.

I completed the review and posted feedback on 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

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR versions the SSH remote-server install path, pins installs to the client release, adds handshake version validation, and updates UI setup states for install-vs-update flows.

Concerns

  • The new inline connection flow can resurrect a session after it was explicitly deregistered while transport.connect() was still in flight.
  • Spontaneous remote-server disconnects no longer attempt the existing reconnect flow, so a transient proxy/server drop permanently disables remote-server-backed features for that SSH session.
  • No security findings were identified in the changed lines.

Verdict

Found: 0 critical, 2 important, 0 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

Comment thread crates/remote_server/src/manager.rs Outdated
Comment thread crates/remote_server/src/manager.rs Outdated
alokedesai and others added 4 commits April 29, 2026 16:02
- Restore the contains_key guard in run_connect_and_handshake before
  inserting Initializing, so deregister_session winning the race against
  transport.connect() doesn't resurrect a torn-down session.

- Restore #9289's attempt_reconnect flow on top of the new version-skew
  + auto-update logic. Spontaneous EOFs from a Connected session now go
  through the existing two-attempt reconnect path instead of being
  permanently terminal.

- Fold the version compatibility check into run_connect_and_handshake so
  a stale-binary mismatch surfaces as ConnectAndHandshakeError::Initialize.
  This naturally avoids triggering reconnect (the session is in
  Initializing, not Connected, when mark_session_disconnected fires).

- Make RemoteTransport object-safe again (Pin<Box<dyn Future>>) so the
  manager can store Arc<dyn RemoteTransport> on Connected for reconnect.

Co-Authored-By: Oz <oz-agent@warp.dev>
- Fix qualified imports in ssh_transport.rs (use imported Future + parse_uname_output)
- Add 5s timeout to remove_remote_server_binary call in run_connect_and_handshake
- Change log::error! to log::warn! for version mismatch message
- Revert transport.rs module doc comment to original wording

Co-Authored-By: Oz <oz-agent@warp.dev>
- Fix error message in remove_remote_server_binary: 'Failed to remove binary: {stderr}'
- Consolidate AwaitingInstall and Updating variants into single AwaitingInstall with for_update bit
- Eliminate nested Result<Result<()>, Timeout> by using unwrap_or_else to flatten

Co-Authored-By: Oz <oz-agent@warp.dev>
@alokedesai alokedesai force-pushed the aloke/autoupdate_remote_server branch from c0a691a to 87fddcb Compare April 30, 2026 13:45
@alokedesai alokedesai merged commit b19866a into master Apr 30, 2026
25 checks passed
@alokedesai alokedesai deleted the aloke/autoupdate_remote_server branch April 30, 2026 14:59
zerx-lab pushed a commit to zerx-lab/warp that referenced this pull request May 3, 2026
…otdev#9328)

## Description


[APP-3805](https://linear.app/warpdotdev/issue/APP-3805/client-server-version-skew)
— handle client/server version skew for the SSH remote-server binary.

Previously the remote binary lived at a single unversioned path. When a
client updated but the remote still had an older binary, the two could
silently go out of sync.

This PR does three things:

1. **Version the installed path.** The binary is now written to
`{dir}/{binary_name}-{version}`, so any client-server drift becomes a
path miss and triggers a reinstall. The unversioned path is kept for
`cargo run` / `deploy_remote_server` dev loops.
2. **Check versions on handshake.** `initialize()` now compares
`server_version` against the client's release tag. On mismatch, the
manager deletes the stale binary, tears the session down, and emits
`SessionConnectionFailed` so the failed-banner path fires.
3. **Auto-update without a prompt.** When `check_binary()` misses but
the remote already has an install directory, we skip the "Install Warp
SSH tools?" modal and install directly with `is_update: true`. The
shimmer reads "Updating Warp SSH Extension..." instead of
"Installing...". Dev clients without a release tag fall through to the
normal prompt so they don't accidentally CDN-install over a
locally-deployed binary.

## Testing

- `cargo test -p remote_server`, `cargo clippy -D warnings`, `cargo fmt`
— all clean.
- Manual against `alokedesai@136.107.29.130`:
  - Fresh install: modal → "Installing Warp SSH Extension..." → Ready.
- Reconnect with a newer client tag: handshake mismatch detected, stale
binary removed, reconnect reinstalls.
- Reconnect with an older client tag while a newer versioned binary is
on the remote: auto-update, no modal, "Updating..." shimmer.
  - Forced install failure on the update path: failed banner renders.

## Server API dependencies

None — warp-server already supports `?version=` on `/download/cli`
(warpdotdev#10284).

---------

Co-authored-by: Oz <oz-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.

2 participants