Harden client tarball download fallback#11151
Draft
alokedesai wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR hardens the client-side SCP fallback tarball download/cache path.
Important base-branch note: the requested cloud base branch
origin/aloke/remote_code_errors_newwas unavailable (git fetchand GitHub branch API returned not found), so this PR is based on and targetsmasterinstead.Changes:
remote_server::transport::Error::ClientDownloadFailedso exhausted client-side downloads are distinguishable from remote-host install/script failures.Diff summary from
git diff origin/master..aloke/client-tarball-decode-hardening | cat:Cargo.lockapp/Cargo.tomlapp/src/remote_server/ssh_transport/installation/scp_fallback.rsapp/src/remote_server/ssh_transport/installation/scp_fallback_tests.rscrates/remote_server/src/setup.rscrates/remote_server/src/transport.rsLinked Issue
ready-to-specorready-to-implement.Testing
cargo fmt --allcargo test -p warp remote_server::ssh_transport::installation::scp_fallback::tests -- --nocapturecargo test -p remote_servercargo clippy -p warp -p remote_server --tests -- -D warnings./script/runScreenshots / Videos
Computer-use validation observed the focused test command passing with:
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 4376 filtered out; finished in 0.53sAdditional artifact:
validation.log(019e3759-11a0-717b-a831-40c9454a3f44). It contains the focused test output and Docker availability check.Docker/SSH-container limitation:
bash: docker: command not found). The closest demonstrable repro/fix artifact is the controlled local HTTP endpoint exercised by the new mockito-backed tests: invalid/truncated tarball bodies are rejected/retried, later valid responses succeed, invalid cache entries are discarded, and repeated invalid responses produce a recognizable client download failure.Agent Mode
CHANGELOG-BUG-FIX: Harden SSH remote-server SCP fallback downloads against corrupt client-side tarball responses and invalid cached tarballs.
Conversation: https://staging.warp.dev/conversation/0e2319dd-35f8-47ef-8aea-a2df29a2a3a5
Run: https://oz.staging.warp.dev/runs/019e3748-dacd-710a-948c-011597f08232
Co-Authored-By: Oz oz-agent@warp.dev
This PR was generated with Oz.
Additional non-Docker localhost SSH repro
Follow-up validation created a local
sshdon port 2222 with a constrainedplaceholderuser so the commands matched Warp's productionplaceholder@placeholderControlMaster/SCP shape.Artifact evidence:
non_docker_ssh_repro.log(019e37c2-783c-76bd-9942-a9e6c68a4111).run_repro.sh(019e37c2-7a2a-7b38-a1e8-083f076744ab).Observed flow:
placeholderonLinux x86_64with/usr/bin/curland/usr/bin/taravailable.73 of 219 bytes), causing direct remote install to fail as expected withcurl: (18) transfer closed with 146 bytes remaining to read.219 bytes), andtar -tzflistedoz(client_download_validation=tar_list_ok).~/.warp-dev/remote-server/warp-oss --versionreturningwarp-oss fake remote server v1.Computer-use validation also observed the saved log and confirmed the truncated-first/full-second request sequence plus staged install success.