Skip to content

fix(harness): stream sandbox uploads through tar#1881

Open
guslegend0510 wants to merge 9 commits into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1876-sessiontree-upload-tar
Open

fix(harness): stream sandbox uploads through tar#1881
guslegend0510 wants to merge 9 commits into
agentscope-ai:mainfrom
guslegend0510:fix/issue-1876-sessiontree-upload-tar

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

AgentScope-Java Version

2.0.0-SNAPSHOT

Description

This PR fixes #1876.

On Windows, large SessionTree mirror uploads in the Docker sandbox could hit CreateProcess error=206 because SandboxBackedFilesystem.uploadFiles() inlined file contents as Base64 into a docker exec command.

The fix changes sandbox uploads to stream each file as a single-file tar archive and hydrate it through Sandbox.hydrateWorkspace(InputStream) instead of passing the payload through the command line. This removes the Windows command-line length limit from session mirror uploads while keeping existing sandbox behavior unchanged.

A regression test was added to verify that uploads go through tar hydration and no longer shell out via exec().

How to test

mvn -pl agentscope-harness -am -Dtest=SandboxBackedFilesystemTest test

Related issues

Fixes #1876

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.83673% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...nt/filesystem/sandbox/SandboxBackedFilesystem.java 91.83% 0 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/harness agentscope-harness (test/runtime support) labels Jul 11, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Fixes #1876: Changes sandbox uploads from base64-inlined shell commands to tar stream hydration, removing Windows command-line length limit. Approach is correct. Verify SubAgentToolTimeoutRetryIntegrationTest.java compiles cleanly - old file-based assertions may conflict with new latch-based ones.

"Invocations should be frozen at %d. Agent loop did not restart."
.formatted(invocations));
// ---- proof #2: cancellation propagates to the inner tool execution ----
// Since sink.onCancel(lifecycleDisposable) properly disposes the inner

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[critical] Verify that old file-based assertions (referencing removed tmpFile field, Files/Path imports) have been properly removed. Coexistence with new latch/counter assertions may cause compilation failures.

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

Labels

area/harness agentscope-harness (test/runtime support) enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows 下 SessionTree 镜像大文件触发 CreateProcess error=206

4 participants