feat(proxy): support persistent OpenSandbox sessions#1262
Merged
Conversation
zhongwen666
reviewed
Jul 21, 2026
zhongwen666
approved these changes
Jul 21, 2026
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
create_session,run_in_session, andclose_sessionthrough the official SDK(sandbox_id, ROCK session name) -> OpenSandbox session idmappings in Redis so sessions work across Admin workersremote_useronly when it matches that effective user, otherwise return a clear 4xxx unsupported errorenv_enable=trueCompatibility behavior
OpenSandbox execd owns the persistent shell process, so the session naturally inherits the sandbox/container environment and effective user. ROCK does not install or fall back to Rocklet on this path.
For
remote_user:Explicit
envvalues andstartup_sourcefiles are initialized inside the new session. Environment names and shell values/paths are validated or quoted before execution.Concurrency and cleanup
The Redis registry uses optimistic transactions and opaque reservation ownership tokens:
Verification
ruff format --checkon all changed files: passedruff checkon all changed files: passedgit diff --check: passedtest_docker_deployment:Container process terminated) and a subsequent Rocklet container-start hang; the same failure reproduces on unmodified master and does not touch this PR's OpenSandbox pathsDelivery plan
This is the required second step from #1233's delivery plan:
The user-facing guide remains last so it documents stable post-session behavior. Raw TCP portforward over WebSocket, mixed-operator migration within one Admin, and remote command cancellation remain outside this PR.
Refs #1202