feat(execd): support line-based file reading with offset + limit#1030
feat(execd): support line-based file reading with offset + limit#1030Pangjiping wants to merge 6 commits into
Conversation
Add offset (1-based line number) and limit (line count) query parameters to GET /files/download for line-based reading, mutually exclusive with the existing Range header. Uses bufio.Scanner for streaming line reads without buffering the entire file. Updates across all layers: execd handler, OpenAPI spec, and all five SDKs (Python async/sync, JavaScript, Kotlin, C#, Go). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fee7b3b463
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Increase bufio.Scanner buffer to 1 MiB and check scanner.Err() to handle long lines gracefully instead of silently truncating - Add text/plain response documentation to OpenAPI spec for line-based read mode - Regenerate Python and JavaScript SDK clients from updated spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5b48e7b2c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Handle errcheck lint for scanner error Write call. Add backward-compatible Kotlin interface overloads so Java callers can still use the original positional arg signatures (3-arg readFile, 2-arg readByteArray/readStream). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move limit check after write in scan loop to avoid scanning one extra line past the requested range - Fix Python async/sync adapters: put path in params dict instead of URL query string so httpx doesn't drop it when offset/limit params are added - Simplify _DownloadRequest type (params always present) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused `quote` import from Python async/sync adapters (ruff F401) - Apply spotless formatting to Kotlin overload methods Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10eb87bb3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add line-based reading (offset/limit) e2e tests for Go, Python (async + sync), JavaScript, Java, and C#. Each test writes a 5-line file and verifies offset+limit, offset-only, and limit-only reads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
offset(1-based line number) andlimit(line count) query parameters toGET /files/downloadfor line-based reading, mutually exclusive with the existingRangeheaderbufio.Scannerfor streaming line reads without buffering the entire fileCloses #1003
Test plan
go test ./...)🤖 Generated with Claude Code