Skip to content

fix(sandbox): snapshot workspace existence before start() so bootstrap files copy#3166

Open
nankingjing wants to merge 1 commit into
volcengine:mainfrom
nankingjing:fix/bootstrap-files-never-copied
Open

fix(sandbox): snapshot workspace existence before start() so bootstrap files copy#3166
nankingjing wants to merge 1 commit into
volcengine:mainfrom
nankingjing:fix/bootstrap-files-never-copied

Conversation

@nankingjing

Copy link
Copy Markdown
Contributor

Summary

Sandbox bootstrap files were never copied into a workspace that already existed on disk, so a reused workspace never received its bootstrap content.

Problem

The bootstrap-copy decision was made after start() had already created the workspace directory, so the "does the workspace exist?" check always saw it as present and skipped the copy.

Fix

Capture workspace_existed = workspace.exists() before calling start(), and drive the bootstrap-copy decision off that pre-start snapshot, so a genuinely new workspace gets its bootstrap files.

Test

bot/vikingbot/tests/unit/test_sandbox_bootstrap.py — covers bootstrap copy on a fresh workspace vs skip on a pre-existing one (2 passed).

Backends create the workspace directory as their first start() step,
so checking workspace.exists() after start() always returned True and
the bootstrap-copy branch was dead. Snapshot existence before start()
so bootstrap files are copied for genuinely new workspaces.
@nankingjing

Copy link
Copy Markdown
Contributor Author
Self-reviewed: diff is correct, minimal, and well-tested. No issues found.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant