Skip to content

Support large sandbox uploads in adapt files put - #37

Open
scsmithr wants to merge 1 commit into
mainfrom
sean/direct-sandbox-uploads
Open

scsmithr wants to merge 1 commit into
mainfrom
sean/direct-sandbox-uploads

Conversation

@scsmithr

@scsmithr scsmithr commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

adapt files put now uploads regular files larger than 16 MiB using the Platform file upload API. The CLI computes SHA-256 incrementally, sends 8 MiB ranges, and seeks to the offset confirmed by the server after a transient failure. Memory usage stays bounded as file size grows.

The command syntax and output are unchanged. The small-file path, stdin uploads and downloads retain their existing behavior. Release this after the node and API changes are deployed. Goblin node · Platform API

Verification

  • Passed cargo test --locked and Clippy for all targets.
  • Ran adapt files put against a local Platform API backed by a real Goblin VM and uploaded an 18 MiB file using a sandbox ID prefix.

@the-adaptile the-adaptile Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Confidence Score: 2/5

Summary

Adds incremental SHA-256 hashing and 8 MiB resumable uploads for regular files larger than 16 MiB. This introduces a stateful transfer path dependent on the companion Platform/Goblin protocol.

Local validation on Linux:

  • cargo test --locked --workspace: 159 passed.
  • cargo clippy --locked --all-targets -- -D warnings and cargo fmt --all -- --check: passed.
  • Python publishing tests: 9 passed.
  • Exercised nine loopback fault-injection scenarios.

Traced the companion Platform and Goblin implementations. Real-VM transfers and non-Linux targets were not exercised locally.

Important Files Changed

File Changes
src/upload.rs Implements incremental hashing, ranged uploads, acknowledgement validation, and recovery.
src/commands.rs Routes regular files above 16 MiB through the new uploader.
src/api.rs Exposes existing retry classification to the uploader.
tests/cli.rs Adds a large-upload recovery test using a sandbox prefix.
Cargo.toml Makes checksum dependencies available on every platform.
src/main.rs Registers the upload module.
docs/cli-reference.md Documents large-file upload behavior and remaining transfer limits.
skills/adapt/SKILL.md Updates the bundled agent guide’s transfer limits.

Run info

Field ID
Agent 0d6ccd7e-b62f-4075-a561-199d1a7b1bf0
Automation ec14e69d-634f-4af0-a6dd-27aa06a1f6b3
Run 6be87fbc-dc36-4408-8e1d-2c8292c0776b

Reviewed: fa0bff6-4d8e525 · ↻ Re-run review

Comment thread src/upload.rs
Ok((file, size, hex::encode(hash.finalize())))
})
.await??;
let route = format!("/v1/sandboxes/{sandbox}/file-uploads/{}", Uuid::new_v4());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P1] Must fix: Pin the resolved sandbox throughout the upload

Every request re-resolves the original prefix. If its sandbox is deleted and another matches, the 404/reopen path uploads into that other sandbox (reproduced). Pin subsequent requests to the first acknowledged sandboxId.

Comment thread src/upload.rs
if next.complete {
return Ok(next.sandbox_id);
}
if progress.is_some() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P2] Must fix: Reset retries when reconciliation confirms progress

Reopening clears progress, so confirmed offset advances never reset retries. Four lost range acknowledgements abort a 32 MiB upload—even after commit (reproduced). Reset the budget when reconciliation confirms forward progress.

@scsmithr scsmithr added the hold label Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant