Skip to content

OpenShell clean-up removes only the sandboxes its own state folder made - #704

Merged
rohitprasad15 merged 1 commit into
mainfrom
sandbox-owner
Sep 29, 2026
Merged

rohitprasad15 merged 1 commit into
mainfrom
sandbox-owner

Conversation

@rohitprasad15

Copy link
Copy Markdown
Collaborator

Why

Each OpenWorker process cleans up OpenShell sandboxes at start. It deleted any sandbox missing from its own records, and those records are per state folder. On a Linux machine, a second OpenWorker with another state folder deleted the live sandbox of the machine's session.

What

  • Each state folder has a stable ID. Every OpenShell sandbox is labelled with the ID of the state folder that made it.
  • Clean-up lists only sandboxes with its own ID, and checks the label again itself.
  • The live session test now ticks the site it expects, since nothing is allowed by default after Simplify the Sandbox settings page. #701.

How to try it

On a machine with OpenShell, start a session so its sandbox exists. Then start a second server with another state folder (COWORKER_STATE_DIR=/tmp/other openworker-server --port 8797). The first sandbox is still listed in openshell sandbox list.

Tested

  • pytest: 2,708 pass (the 2 test_tool_result_cap failures are on main too).
  • On an Ubuntu 24.04 VM with OpenShell 0.0.116, all 23 live OpenShell tests pass, run twice. The incident was replayed and the live sandbox survived.

Not in this PR

  • Windows and Mac sandboxes: their clean-up already checks whether the owning process is alive.

Each sandbox carries its registry's id; a second OpenWorker (test server, one-shot run) no longer deletes live sandboxes.
The live session test ticks the site it expects, since nothing is allowed by default.
@rohitprasad15
rohitprasad15 marked this pull request as ready for review September 29, 2026 18:40
@rohitprasad15
rohitprasad15 merged commit 8c2f7d7 into main Sep 29, 2026
6 checks passed
@rohitprasad15
rohitprasad15 deleted the sandbox-owner branch September 29, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant