Skip to content

fix(workspace): clean up failed Docker initialization - #3098

Merged
DavdGao merged 3 commits into
agentscope-ai:mainfrom
quifox:fix/docker-workspace-init-cleanup-pr
Oct 8, 2026
Merged

DavdGao merged 3 commits into
agentscope-ai:mainfrom
quifox:fix/docker-workspace-init-cleanup-pr

Conversation

@quifox

@quifox quifox commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

When Docker workspace initialization fails after container creation, the manager never caches the workspace, so close_all cannot reclaim its resources. Attempt to close the unreturned workspace before propagating the original initialization error or cancellation. If cleanup also fails, log the cleanup failure and preserve the original error.

Add public get_workspace regression coverage for initialization failure, task cancellation, cleanup failure, successful retry, and cached reuse.

Validation:

  • pytest tests/workspace_manager_docker_init_test.py tests/workspace_manager_docker_test.py tests/workspace_prewarm_test.py -q — 20 passed.
  • pre-commit run --all-files — passed.

The lifecycle tests use a Docker SDK double. Live Docker integration has not been run.

Fixes #3099

@github-actions github-actions Bot added pr/awaiting-review Waiting for maintainers to review this PR pr/no-linked-issue This PR does not link to any issue labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for the pull request. One thing worth sorting out before it is reviewed:

  • This pull request does not close an issue. Please open one describing the problem first and link it with Fixes #<number>, so the change can be discussed against the problem it solves.

If you think it belongs here anyway, say so and a maintainer will take a look.

@github-actions github-actions Bot removed the pr/no-linked-issue This PR does not link to any issue label Oct 3, 2026
DavdGao and others added 2 commits October 8, 2026 11:22
Dispose the unreturned workspace the same way the E2B manager does and
fold the regression test into the existing Docker manager suite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@DavdGao
DavdGao merged commit d8283ff into agentscope-ai:main Oct 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr/awaiting-review Waiting for maintainers to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DockerWorkspaceManager does not clean up failed initialization

2 participants