Repository navigation
fix(harness): strip base64 line wrapping in sandbox binary reads (#3966) - #4196
Merged
Merged
Conversation
aiyili
added a commit
to aiyili/agentscope-java
that referenced
this pull request
Nov 15, 2026
The ubuntu job failed on RocketMqExecutionTest.agentScopeResumesThroughSeparateLedgersDespitePublicationAndAckFailures (polling deadline 'Condition did not become true', 10s await under CI load). The test lives in the durable-rocketmq extension, references no HarnessAgent API, and passed on the sibling PR runs (agentscope-ai#4194/agentscope-ai#4196) minutes earlier — a timing flake, not a regression from this diff. Re-triggering CI.
juruoO-o
approved these changes
Nov 19, 2026
2 tasks done
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.
Summary
Reading a binary file through a sandbox filesystem returns a payload with embedded newline characters.
Root cause: POSIX
base64wraps output at 76 columns with newline separators, butBaseSandboxFilesystem.readonly.strip()s the outer edges before handing the string toFileData(content, "base64"). The local and remote backends emit single-line base64 (Base64.getEncoder().encodeToString), so the sandbox backend is both inconsistent across backends and undecodable with the strictBase64.getDecoder()(which rejects line separators), while the model also sees broken payload text.Fix
Strip all whitespace from the command output before constructing
FileData— the POSIX base64 output is exactly the base64 alphabet plus separators, so\\s+removal changes nothing for well-formed payload bytes.Regression
read_binary_wrappedBase64Output_strippedToSingleLinePayload: an 80-byte fixture force-wrapped byBase64.getMimeEncoder(76, newline)must come back single-line and round-trip through the strictBase64.getDecoder().Full harness module suite green on the merged batch state (1833/1833).