feat(sdks): support byte range reads via start/end in files.read#1364
feat(sdks): support byte range reads via start/end in files.read#1364mishushakov wants to merge 1 commit into
Conversation
Adds optional `start` / `end` parameters to `files.read` in both the JS and Python SDKs. When set, the SDKs send an HTTP `Range: bytes=<start>-<end>` header to `GET /files`, which envd already serves via `http.ServeContent`. Semantics match HTTP Range (inclusive end, zero-based). Negative values and inverted ranges raise `InvalidArgumentError` / `InvalidArgumentException` before any request is made. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 215f7cd The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR SummaryLow Risk Overview Reviewed by Cursor Bugbot for commit 215f7cd. Bugbot is set up for automated code reviews on this repo. Configure here. |
Package ArtifactsBuilt from 5711917. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.27.1-mishushakov-range-header-file-reads.0.tgzCLI ( npm install ./e2b-cli-2.10.3-mishushakov-range-header-file-reads.0.tgzPython SDK ( pip install ./e2b-2.25.0+mishushakov.range.header.file.reads-py3-none-any.whl |
Summary
Adds optional
start/endparameters tofiles.readin both the JS and Python SDKs (sync + async). When set, the SDKs send an HTTPRange: bytes=<start>-<end>header toGET /files— envd already serves this viahttp.ServeContent, so no infra change is needed. Semantics match HTTP Range (inclusive end, zero-based); negative values or inverted ranges throwInvalidArgumentError/InvalidArgumentExceptionbefore any request is made. Closes #1054.Test plan
pnpm run format,pnpm run lint,pnpm run typecheckpnpm exec vitest run tests/sandbox/files/read.test.ts(needs live sandbox)poetry run pytest tests/{sync,async}/sandbox_*/files/test_read.py(needs live sandbox)🤖 Generated with Claude Code