fix(sandbox): use updated WorkspaceSpec when resuming from persisted state#1927
Closed
Buktal wants to merge 8 commits into
Closed
fix(sandbox): use updated WorkspaceSpec when resuming from persisted state#1927Buktal wants to merge 8 commits into
Buktal wants to merge 8 commits into
Conversation
…dboxClient.resume()
… middleware rollback
…eStore scope-value overloads Add a public factory method SandboxIsolationKey.of(scope, value) so that out-of-band callers (restore, archive, scavenger) can build a key without a RuntimeContext or guessing the internal slotSessionId format. Add SessionSandboxStateStore.load(scope, value) / save(scope, value) convenience overloads so that application code no longer needs to construct SandboxIsolationKey objects manually.
…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
Contributor
Author
|
Closing this PR - will recreate from clean main branch to avoid including unrelated commits |
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 (commit ddad83a)
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)