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

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

Conversation

@nankingjing

@nankingjing nankingjing commented Jul 11, 2026 •

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/tests/test_sandbox_bootstrap.py (2 tests) — covers bootstrap copy on a fresh workspace vs. skip on a pre-existing one. Both pass.

@nankingjing

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

@nankingjing
nankingjing force-pushed the fix/bootstrap-files-never-copied branch 2 times, most recently from 3fdae1f to 91967be Compare September 26, 2026 11:15
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
nankingjing force-pushed the fix/bootstrap-files-never-copied branch from 91967be to d7839ae Compare October 22, 2026 05:30

This branch has not been deployed

No deployments
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