Skip to content

Fix remote sandbox leaks on reset and dashboard backend validation - #88

Open
GuzmanPintos wants to merge 2 commits into
evo-hq:mainfrom
GuzmanPintos:fix/reset-and-dashboard-validation
Open

Fix remote sandbox leaks on reset and dashboard backend validation#88
GuzmanPintos wants to merge 2 commits into
evo-hq:mainfrom
GuzmanPintos:fix/reset-and-dashboard-validation

Conversation

@GuzmanPintos

@GuzmanPintos GuzmanPintos commented Jul 22, 2026

Copy link
Copy Markdown

Both were found while testing the Tenki provider (#87), but the bugs predate it and hit every remote provider.

evo reset leaked per-experiment sandboxes. It only ran reset_all on the workspace-default backend, so sandboxes created with a per-experiment override (evo new --remote <provider> on a worktree-default workspace) were never torn down. Reset now runs reset_all for every distinct backend spec in the run, remote specs first. Remote reset_all deletes only its own state file instead of the whole run directory (other specs still need those files); core wipes the run dir once every backend has reset. A failure in one backend no longer stops the rest, and failures are re-raised at the end so reset exits non-zero when a sandbox may still be running.

The dashboard execution endpoint mishandled malformed payloads. Posting provider_config as a string or with nested object values returned a 500; posting a list silently wiped the saved settings. It now validates the payload shape and returns 400 with a message, and maps provider construction failures (BackendError) to 400 as well. load_provider wraps constructor crashes in RemoteBackendUnavailable, which also fixes the 500 when you save a config for a provider whose SDK isn't installed.

inherit_shell: true no longer forwards the orchestrator's environment into remote sandboxes, where host values like HOME=/Users/... overrode sane in-sandbox values and broke tools that read them (npm ci fails on a Linux box handed a macOS HOME). Local runs keep the old behavior; evo env inherit-shell always opts remote sandboxes back in.

evo reset only reset the workspace-default backend, so sandboxes created
through per-experiment overrides were never torn down. reset now runs
reset_all for every distinct backend spec, remote specs first.

- Propagate teardown failures from reset and preserve state for retry:
  failed sandboxes stay in the state file and the error propagates; core
  keeps the run directory when any remote teardown fails so a second
  reset can retry cleanup.
- Stop inheriting the host shell env into remote sandboxes: inherit_shell
  true now applies to local runs only; a new 'always' value opts remote
  sandboxes back in.
- Validate the dashboard execution endpoint payload shape, reject
  non-scalar values, and map BackendError to 400; load_provider wraps
  constructor crashes in RemoteBackendUnavailable.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread plugins/evo/src/evo/backends/remote.py
Comment thread plugins/evo/src/evo/core.py
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