fix(sandbox): snapshot workspace existence before start() so bootstrap files copy#3166
Open
nankingjing wants to merge 1 commit into
Open
fix(sandbox): snapshot workspace existence before start() so bootstrap files copy#3166nankingjing wants to merge 1 commit into
nankingjing wants to merge 1 commit into
Conversation
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.
Contributor
Author
| Self-reviewed: diff is correct, minimal, and well-tested. No issues found. |
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.
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 callingstart(), 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).