Skip to content

fix: ensure AgentRun workspace root before hydration#2220

Open
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:fix/2216-agentrun-workspace-root
Open

fix: ensure AgentRun workspace root before hydration#2220
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:fix/2216-agentrun-workspace-root

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

Fixes #2216

Summary

  • ensure AgentRun workspace root is created before hydration
  • fail fast when workspace root setup returns a non-zero exit code
  • add AgentRun sandbox tests for setup failure and hydration ordering

Tests

  • mvn -pl agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-agentrun test

@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

This PR fixes issue #2216 where AgentRun sandbox hydration could fail with a tar extraction error because the workspace root directory was never created beforehand. The fix implements doSetupWorkspace() with a real mkdir -p + exit-code check, adds defensive ensureWorkspaceRoot() inside doHydrateWorkspace() for callers that bypass start(), and introduces an AgentRunExecutor inner interface to decouple AgentRunSandbox from the concrete AgentRunMcpChannel, enabling unit tests. The change is focused, well-tested, and consistent with patterns used in DaytonaSandbox and E2bSandbox.

(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)

@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

This PR fixes issue #2216 where AgentRun sandbox hydration could fail with a tar extraction error because the workspace root directory was never created beforehand. The fix implements doSetupWorkspace() with a real mkdir -p + exit-code check, adds defensive ensureWorkspaceRoot() inside doHydrateWorkspace() for callers that bypass start(), and introduces an AgentRunExecutor inner interface to decouple AgentRunSandbox from the concrete AgentRunMcpChannel, enabling unit tests. The change is focused, well-tested, and consistent with patterns used in DaytonaSandbox and E2bSandbox.

(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)

@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/harness agentscope-harness (test/runtime support) labels Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/extensions/sandbox/agentrun/AgentRunSandbox.java 85.71% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: AgentRun tar extract failed: tar: /home/agentscope/workspace: Cannot open: No such file or directory

2 participants