Repository navigation
fix(adapters): read files over commands in 512 KiB pieces - #137
Merged
Merged
Conversation
shellcmd.ReadFile returned a whole file as base64 in one command's output. Agent Platform's :execute answers are capped near 1 MB (a third party's measurement), so a file over about 750 KB failed there; agentcore and northflank read the same way. Reads now go in 512 KiB pieces (under 700 KB of output each): the first command also prints the size, so a small file still takes one command, and a file whose size changes while it is read is refused instead of spliced. Tested with a local shell; not run against the backends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jalil <reachjalil@gmail.com>
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.
shellcmd.ReadFile, the file read for backends whose only primitive is "run a command" (gcp-sandboxes,agentcore,northflank), returned the whole file as base64 in one command's output. Agent Platform's:executeanswers are capped near 1 MB, by a third party's measurement; Google documents no limit. So ongcp-sandboxesany file over about 750 KB failed, asprovider_unavailable(a 502). This was a leftover from the review of that adapter in #135.Change
head -cand thendd bs=512K skip=N count=1.wc -c), so a file up to 512 KiB still takes a single command.sandbox_failedrather than spliced from two versions.head,ddandwc, which GNU coreutils and BusyBox both provide.Tests: run against a local
/bin/sh.make verifypasses.Not run against Agent Platform, AgentCore or Northflank.
🤖 Generated with Claude Code