fix(sandbox): use updated WorkspaceSpec when resuming from persisted state#1928
Open
Buktal wants to merge 1 commit into
Open
fix(sandbox): use updated WorkspaceSpec when resuming from persisted state#1928Buktal wants to merge 1 commit into
Buktal wants to merge 1 commit into
Conversation
…state When SandboxManager resumes a sandbox from Redis, it now overwrites the stale WorkspaceSpec in SandboxState with the current spec from SandboxContext. This ensures application-layer config changes (e.g., adding .skills-cache to WORKSPACE_PROJECTION_ROOTS) take effect without requiring manual cache deletion. Fixes agentscope-ai#1926
a85ecbd to
1d03843
Compare
Contributor
|
Nice fix — the null check on |
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.
AgentScope-Java Version
2.0.0-SNAPSHOT
Description
Background:
When an application modifies
WORKSPACE_PROJECTION_ROOTSinSandboxFilesystemSpec(e.g., adding.skills-cacheto the projection list), the change is ignored for existing sandboxes resumed from Redis. The sandbox continues using the oldWorkspaceSpecpersisted inSandboxState.Root cause:
SandboxManager.acquire()deserializesSandboxStatefrom Redis and directly passes it toclient.resume(state). TheWorkspaceSpecinsidestatewas captured during the firstcreate()call and is never updated.Changes made:
SandboxManager.acquire()(L106-109) to overwritestate.workspaceSpecwith the currentsandboxContext.workspaceSpecbefore resumingHow to test:
["A", "B", "C"]["A", "B", "C", "D"]where D exists on hostRelated:
Checklist
mvn spotless:applymvn test)