Repository navigation
fix(harness): 使用 tar 流修复 Windows Docker 沙箱会话文件上传失败 - #2557
Merged
jujn merged 4 commits intoAug 6, 2026
Merged
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
|
@jujn 这个问题我看提了很久也没被修复 |
oss-maintainer
approved these changes
Aug 5, 2026
oss-maintainer
left a comment
Collaborator
There was a problem hiding this comment.
Summary
Reviewed the changes in this PR. The modifications look reasonable and follow the project conventions.
Automated review by "github-manager-bot"
Contributor
Author
|
@jujn 您好这个要是可以的话,请帮忙merge一下,感谢🙇 |
jujn
approved these changes
Aug 6, 2026
wzl521
pushed a commit
to wzl521/agentscope-java
that referenced
this pull request
Aug 12, 2026
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.
关联问题
问题背景
在 Windows 主机上使用 Docker 沙箱运行
HarnessAgent时,SessionTree会异步镜像会话 JSONL 文件。原有降级上传路径会执行以下操作:docker exec ... sh -c命令参数;ProcessBuilder启动 Docker CLI。随着会话文件持续增长,Base64 内容会使命令行进一步膨胀,最终在 Docker 进程启动前触发 Windows 命令行长度限制:
该异常并非 Docker 容器内路径过长,而是宿主机无法创建携带超长参数的
docker进程。解决方案
本 PR 保留现有
SandboxFileTransfer原生传输优先级,仅替换不支持原生传输时的上传策略:..路径穿越;Sandbox.hydrateWorkspace(InputStream);docker exec -i ... tar -xf -从标准输入读取归档。文件内容不再进入命令行参数,因此上传大小不再受 Windows
CreateProcess命令行长度限制。兼容性与安全性
SandboxFileTransfer,行为不变。SessionTree的agents/.../sessions/*.jsonl使用方式。SessionTree的异步、best-effort 镜像语义。测试
执行命令:
mvn -pl agentscope-harness -am -Dtest=SandboxBackedFilesystemTest test结果:
13个聚焦测试全部通过;100%;此外,在 Windows 11 Docker Desktop
29.4.3上使用真实python:3.12-bookworm容器完成了手工集成验证:CreateProcess error=206;完整测试也已执行,发现以下与本 PR 无关的 Windows 环境基线问题:
agentscope-core停止:DangerousPathBypassTest的 2 个符号链接用例因当前 Windows 用户缺少创建 symlink 的系统特权而报错;该模块其余 2216 个测试通过。agentscope-harness:685 个测试中 680 个通过、3 个跳过,2 个用例在 JUnit 清理临时会话目录时因异步文件写入产生DirectoryNotEmptyException;本 PR 的 13 个聚焦测试均已通过。变更范围
SandboxBackedFilesystem:将 Base64 命令行上传替换为 tar 标准输入上传,并增加工作区路径约束。SandboxBackedFilesystemTest:补充回归、异常和安全边界测试。本 PR 不包含会话调度、SessionTree 持久化策略、下载逻辑或其他模块的行为变更。