Skip to content

fix(harness): stream Docker sandbox file transfers - #2530

Open
ShinyHero666 wants to merge 1 commit into
agentscope-ai:mainfrom
ShinyHero666:fix/docker-stream-file-transfer
Open

fix(harness): stream Docker sandbox file transfers#2530
ShinyHero666 wants to merge 1 commit into
agentscope-ai:mainfrom
ShinyHero666:fix/docker-stream-file-transfer

Conversation

@ShinyHero666

Copy link
Copy Markdown

AgentScope-Java Version

2.0.1-SNAPSHOT

Description

Fixes #1560.

SandboxBackedFilesystem.uploadFiles previously fell back to a shell command that embedded the complete Base64 payload in the docker exec command line. Large files therefore exceeded the host command-line limit on Windows (CreateProcess error=206) and could also hit E2BIG on Unix-like hosts.

This PR:

  • makes DockerSandbox implement the existing SandboxFileTransfer capability;
  • streams uploads through docker exec -i standard input instead of command-line arguments;
  • streams downloads directly from container standard output;
  • preserves support for workspace-relative and absolute paths, including paths with spaces and quotes;
  • adds regression tests for the native transfer capability and path handling.

Validation performed locally:

  • mvn -pl agentscope-harness -am spotless:apply
  • mvn -pl agentscope-harness -am -DskipTests compile
  • mvn -pl agentscope-harness -am "-Dtest=SandboxBackedFilesystemTest,DockerSandboxFileTransferTest" test (8 tests passed)
  • real Docker round trip of a 1 MiB random binary file through an Alpine 3.22 container, with byte-for-byte verification

The full mvn test suite did not complete within the local validation window, so the full-suite checkbox is intentionally left open for CI.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test); the focused harness tests above pass and CI will run the complete suite
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (not applicable; no user-facing API or documentation changed)
  • Code is ready for review

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@CLAassistant

CLAassistant commented Aug 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ShinyHero666
ShinyHero666 force-pushed the fix/docker-stream-file-transfer branch from ac62daa to dde64d6 Compare August 2, 2026 14:05
@ShinyHero666

Copy link
Copy Markdown
Author

CI note: the new DockerSandboxFileTransferTest passed on both Ubuntu and Windows. In run 30750987683, Ubuntu failed in the unrelated HarnessAgentSubagentStreamEventsTest; an isolated local rerun of that class passed all 4 tests, and Windows was canceled by fail-fast. In run 30751331762, Windows failed in the unrelated AgentSpawnToolPlanModeTest because JUnit could not delete its temporary directory; Ubuntu was then canceled by fail-fast. The new transfer test does not create files or processes, and the affected tests/files are outside this change. I do not have repository permission to rerun Actions. Could a maintainer please rerun the failed checks?

@ShinyHero666

Copy link
Copy Markdown
Author

Thanks for rerunning the checks. The Windows build now passes. The Ubuntu job was canceled mid-build without a test failure. Could you please rerun the Ubuntu check when convenient?

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

Labels

None yet

Projects

None yet

2 participants